Create Timestamp from Feature Layer Field Changes

03-13-2019 07:47 PM
by Anonymous User
Not applicable

Hi everyone,

I have a webmap which uses a view of a parent hosted feature layer. I would like to add a field to my configured popup which would display a timestamp.

The issue I'm having is I would like the timestamp to displayed to be a stamp of the time when two string fields in the parent feature layer view (and parent layer) are both changed from 'null' to 'yes'.

I've tried two approaches so far without any success:

Add a date type field to the parent feature layer, and use an arcade expression to calculate the field with something along the lines of: IIf( $feature.field1 == 'Yes' && $feature.field2 == 'Yes', Timestamp(), null)

When I've tried to implement this approach, the expression tests as valid, however when I try to implement the calculation, ArcGIS Online appears to get stuck on the 'inserting' step of calculating the field.

As an alternative, I've tried to write an arcade attribute expression within the feature layer's popup configuration to perform a similar type of calculation.
When trying to implement the attribute expression calculation, it appears as if the logic in the above calculation isn't being interpreted correctly; for some features within the feature layer which have both fields with a value of 'Yes', the expression is still evaluated as being false and returns a null value.
I've also tried using the When arcade function, but this doens't appear to work either.

In addition to the above issues, I understand that using the timestamp() function will most likely just return the current time whenever the webmap is viewed, rather than the time when both fields within the feature layer are changed to the value 'Yes'.

Does anyone have any suggestions as to how I might be able to incorporate this into my webmap?
As an added note, the parent feature layer is written to by a Survey123 form.

1 Reply
New Contributor III

DId you ever find a solution for this>? I am hoping to do something similar in Web AppBuilder

0 Kudos