How to calculate due date from receivedTime()

1246
4
Jump to solution
07-29-2020 12:43 PM
jessneuner
Occasional Contributor

Hello!

I think I'm missing something simple and hoping the group will be able to set me straight. And possibly offer a different way to accomplish this -- 

We want to calculate a standard due date based on the submit/creation date of problems added to our hosted feature layer. By default, all new problems should be due 5 days after they were created. Because we are already using GeoEvent for a few other things as new records are submitted, thought we could add this in as well.

BUT, I don't know how to do it -- I think that maybe I'm missing a conversion back to date format?

Here's a look at the whole geoevent service: 

Here's what the Calculate Due Date looks like now -- but it does not work -- 

Thanks for any and all ideas!

0 Kudos
1 Solution

Accepted Solutions
jessneuner
Occasional Contributor

Ok - I see what you are saying.  But, I can't change the field type because I was using an existing field -- i think that boolean is irrelevant (and confusing). 

So then - i tried to a new field and then using the field mapper -- but that didn't work either. 


Then, i remembered this: the due date field is new since this geoevent service was created. and even though i had added it to the geoevent definitions i was using for the inputs, etc --- the output service (Update a Feature Service) didn't know about my new duedate field. BUT - i don't know how to fix that without recreating the output service.  

Anyways -- removing this output,  deleting the corresponding output service, recreating it that service, then reconfiguring my geoevent service fixed the use.  The field calculator as originally designed worked as expected. oy!

highlight

View solution in original post

0 Kudos
4 Replies
BrianLomas
Occasional Contributor III

Have you tried using field calculator to fill in a received field then use the received field in your field calculator for due date instead of calculating it all at once?

0 Kudos
jessneuner
Occasional Contributor

No -- but I do have a 'created date' field (editor tracking) so I tried that, but it didn't work either ... 

I'm not totally confident about this millisecond calculation either. the best examples I've seen are only for filtering, not for calculating... but maybe it needs to go to a Long field and then to a date field?

0 Kudos
BrianLomas
Occasional Contributor III

I tested this in our geoevent environment and it seemed to work. It resulted in a time of "Mon Aug 03 15:58:04 CDT 2020"... In the last screenshot your field type is "boolean", you should set it to date type. I hope this helps.

0 Kudos
jessneuner
Occasional Contributor

Ok - I see what you are saying.  But, I can't change the field type because I was using an existing field -- i think that boolean is irrelevant (and confusing). 

So then - i tried to a new field and then using the field mapper -- but that didn't work either. 


Then, i remembered this: the due date field is new since this geoevent service was created. and even though i had added it to the geoevent definitions i was using for the inputs, etc --- the output service (Update a Feature Service) didn't know about my new duedate field. BUT - i don't know how to fix that without recreating the output service.  

Anyways -- removing this output,  deleting the corresponding output service, recreating it that service, then reconfiguring my geoevent service fixed the use.  The field calculator as originally designed worked as expected. oy!

highlight

0 Kudos