I would like to create a field that is auto-populated with the username of the person that last edited a different field in the survey. I am creating a form in field maps, so my thought was that it could be a hidden field in the form (is it even possible to create hidden fields in field maps form designer? I am used to using Survey123). But really it would be nice if the field had an arcade expression that always updated it with the editors username anytime the field was edited (when using the field maps form, or editing in map viewer, or editing in Arc Pro).
Example:
I have a Trap Check field layer that has the following fields:
Date of First Trap Check, Date of Second Trap Check, Date of third Trap Check
When a user checks a trap, they select one of those fields and record the date. I would like to have three other fields that are automatically updated:
Editor of First Trap Check, Editor of Second Trap Check, Editor of Third Trap Check
Those fields would automatically record the username of whoever last updated the associated Date of Trap Check field.
Does anyone know how I can accomplish this?
Thanks,
-Andy
There are two routes to go that I can think of off the top of my head, without getting into the weeds of Views & such:
Option 2 is a big rabbit hole whose answers will largely change based on what platform you're accessing. To my knowledge, there is no singular "one-stop-shop" like Editor Tracking for this case.
To give a broad overview of the concept, though:
You'd want to run a script on every edit that reads the user's login name and writes it to the relevant field based on some criteria. In Field Maps and/or AGOL, you'd do this in the Form Designer. In ArcGIS Pro, you'd probably do this via Attribute Rules.
There's a function in Arcade (whose name escapes me) that can read a user's login name or display name. I vaguely remember one of them being buggy when we tested it on our end; I think the problem child was the display name.
In Pro, my gut sense is that I'd probably attach the Rule to the Date field and then have it write to the User field on edit, but I'd have to tinker a bunch to see if that actually works.
In AGOL/Field Maps, I think you'd attach the code to the User field as an auto-calculation. The trick would be detecting the change in the relevant date field.