Select to view content in your preferred language

Populate Date field with Arcade

4854
11
05-06-2019 07:42 AM
ScottEvans6
New Contributor III

I am trying to populate a date field, with the date and time from the exact moment another field is updated. I am using Arcade to do this. I have been able to get the local time from the machine, and populate the date field when the other field is updated, but it keeps updating every second. I want the time field to stay at the time when the other field is first updated, and to not keep automatically updating. Below is the Arcade code:

var ResDate = ToLocal(TimeStamp())
var Status = $feature.Status

IIf(Status == 'Resolved', ResDate, null)

I am then putting this arcade expression in the layer's pop up. So, once a feature's status field is changed from 'Unresolved' to 'Resolved', I want the time to be grabbed and put in the new resolve date field. However, that time keeps getting pulled and updated. I tried using the 'break' operator for arcade with no success. So essentially, I am hoping to pull the time once, and leave it. Any help would be awesome! Arcade is still new and finding detailed documentation can be difficult. Thanks!

Scott

0 Kudos
11 Replies
KellyGerrow
Esri Frequent Contributor

Hi Marques,

Thanks for the feedback. Am i correct, in that you only want the date recorded when a specific attribute is changed? For example: Only record the last precipitation date, if the users specifies Yes for the precipitation field.

Would you want to have more than one of these types of calculations per feature?

-Kelly

Jean-FrancoisBrisson
New Contributor

Hello,

I have the exact same question (I want to do the same thing as Scott) !

Do we have a final answer ?

Thank you,