Select to view content in your preferred language

Record last editor of a field

178
1
02-25-2025 08:21 AM
Labels (1)
AndrewMoskaLee
Occasional Contributor

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

0 Kudos
1 Reply
MErikReedAugusta
MVP Regular Contributor

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:

  1. The built-in Editor Tracking functionality that's already available and functional in all ESRI products (that I know of).  Just run the Enable editor tracking GP tool on the dataset, and Bob's your uncle!  This only allows ONE editor name to be saved at any one time, though, so you wouldn't be able to track those three Trap Check fields independently.
  2. Arcade scripts

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.

------------------------------
M Reed
"The pessimist may be right oftener than the optimist, but the optimist has more fun, and neither can stop the march of events anyhow." — Lazarus Long, in Time Enough for Love, by Robert A. Heinlein