How can I extract editors user name in arcade function?

680
5
Jump to solution
09-10-2019 09:53 AM
MatthewSyvertson
Occasional Contributor II

I want to populate a field with user name using attribute rules, but I can't find an arcade function to extract this information.

0 Kudos
1 Solution

Accepted Solutions
XanderBakker
Esri Esteemed Contributor

Hi syvertson ,

If you enable tracking on your hosted feature layer, this information will be available to you, since it is stored in several fields: Manage hosted feature layers—ArcGIS Online Help | ArcGIS 

View solution in original post

5 Replies
XanderBakker
Esri Esteemed Contributor

Hi syvertson ,

If you enable tracking on your hosted feature layer, this information will be available to you, since it is stored in several fields: Manage hosted feature layers—ArcGIS Online Help | ArcGIS 

View solution in original post

MatthewSyvertson
Occasional Contributor II

Thank you Xander.  That will work perfect for this particular task. 

In a case where I would like to access the user information for another field update, is it even possible?  Or are we constrained to the list of functions on the Arcade Function Reference | ArcGIS for Developers?

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Matthew Syvertson , 

The editor tracking records the creation of a feature and the last update.  So it will record when a feature is modified (by for instance changing an attribute), but it will only record the last update. So, if user A creates a feature, user B modifies the geometry and than user C changes an attribute, you will have information about user A who created the feature, and user C who modified the attribute. There will be no information about the modification of user B. To have access to all modifications you would need to implement branch versioning in your enterprise geodatabase.

In case you are interested in the modifications performed in another layer, this can be done by Arcade, but the scenario above does not require any Arcade functionality. 

In case I misunderstood your question, please provide an example of what you would like to achieve.

0 Kudos
MatthewSyvertson
Occasional Contributor II

Let's say you want to create an expression in another field all together from the provided "created user" field.  So I want to capture at edit time the feature creator and evaluate whether that creator is in another table. and return a Boolean result, or maybe even disallow that edit from happening all together.  

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Matthew Syvertson ,

To do this at edit time would either require attribute rules (Introduction to attribute rules—Geodatabases | ArcGIS Desktop ) to allow an edit or the creation of hosted feature layer views (Create hosted feature layer views—ArcGIS Online Help | ArcGIS ) per permission and share that in groups with the appropriate users. A normal Arcade expression could connect to another table and validate if a user is listed, but it would require an attribute rule to "make it do something".

0 Kudos