Auto-populate a permanent field based on Arcade Expression

4831
14
04-19-2019 02:16 PM
Status: Open
KaraUtter
Occasional Contributor III

Hello,

It would be very helpful in ArcGIS Online if a layer could have a permanent field that is set up with an arcade expression that the field uses to auto-populate its value based on information from another field as new records are created from map applications. 

For example, we track our time and each record has a CATEGORY (meeting, project, internal support, etc.) that we define for our new record. These categories are then defined as 1 of 4 bins for strategic DELIVERY classification (Alignment, Projects, Support, Value). I created a blank field that only I see on the back-end named DELIVERY, which I calculate each day using an arcade expression that reads the CATEGORY field and then based on that value will fill in the DELIVERY cell as either Alignment, Projects, Support or Value. This DELIVERY field is used to provide a bar graph in a separate WebApp Builder dashboard template application that was created for our IT coordinator.

Though I can define an attribute expression with an Arcade Expression that WILL auto-generate the attribute expression field in the map, this can only be seen and used in the map pop-ups and are not visible within any of the graphic widgets for the story maps. If we could define an arcade expression for a field and allow for auto-generation of a permanent field value, that would be very helpful in streamlining dashboard processing.

Thanks,

Kara

arcade expression‌ auto populate‌

14 Comments
XanderBakker

In other words, implement Attribute Rules for ArcGIS Online...

GeneSipes1

I am trying to do this very thing. I have 6 fields in a sidewalk assessment map that I want summed into a 7th field for a total score of the 6 fields. I want this to occur on the fly as values are populated into those six fields. I am assuming nothing has been developed since this thread was created?

JamesWilson2

It would be great to do this. I can currently do it in Survey123, but as Survey123 has very limited options for recording line geometry I would like to be able to populate a field based on other fields (in this case, an average) as a form is filled out in a webmap and in collector.

AaronWipf

I assumed this was possible and quickly found out it was not, I'd love to see it added in!

In my case, I have to conform to a previously established schema, so I'd like to populate a custom GPS accuracy field with a simple expression that converts the value from the default ESRIGNSS_H_RMS field into feet. Again, could be done in Survey123 (but we have a security incompatibility that prohibits Survey123 from submitting data to an ArcGIS Server feature service) or it could be an extra processing step outside of Collector, but it would be much cleaner to have the functionality baked in.

KoryKramer
AlixVezina

Please review the following article published on 3 January 2021: Introducing smart forms in ArcGIS Field Maps (esri.com)

Near the bottom of the article: 

Attribute rules – are user-defined rules that can be used to automatically populate attributes, restrict invalid edits, and perform quality assurance checks on existing features when they are submitted. Attribute rules are coming to hosted feature services and to forms so that you can execute business logic in your form connected or offline.

Smart forms may provide the capabilities you require moving forward.

SandraDalton

@AlixVezina Is there a timeline for attribute rules being implemented in AGOL hosted feature layers?

AlixVezina

@SandraDalton  I don't know the details, but it looks like it's in the pipeline. No target date has been provided yet, that I am aware of.

BamJam
by

@AlixVezina I have a need to have placeholder value for some fields, but not a default value.  I have feature templates that contain multiple feature types, and I'd like to have these placeholders dynamically defined for fields for each feature type.  I know that HTML5 has the placeholder capability that would be perfect. 

BamJam_1-1654884046605.png

 

Is this possible within using Arcade, Smart Forms with Field Maps, or in the Smart Editor widget in WAB?

Also, is there an update to Attribute Rules for hosted feature services?

AlixVezina

@BamJam , for the Smart Editor and the Edit widgets in WAB, the best way to do something similar to a placeholder hint is to add a Hint for the field in the web map pop-up configuration (map viewer classic).

AlixVezina_0-1654886168166.png

The hint will display in a tooltip when the field is in focus.

AlixVezina_1-1654886237521.png