How to calculate due date from receivedTime()

164
4
Jump to solution
07-29-2020 12:43 PM
New Contributor III

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!

Reply
0 Kudos
1 Solution

Accepted Solutions
New Contributor III

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

Reply
0 Kudos
4 Replies
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?

Reply
0 Kudos
New Contributor III

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?

Reply
0 Kudos
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.

Reply
0 Kudos
New Contributor III

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

Reply
0 Kudos