Select to view content in your preferred language

Creating the ability to update a field in a hosted layer when geometry is updated.

254
2
Jump to solution
05-21-2025 08:42 AM
Labels (1)
BrianHartz_Lumos
Emerging Contributor

We currently have hosted line features that have a field that represents calculated length ( in feet). We have turned on the ability for users to be able to update geometry to either cut or reshape a line segment. Is there any settings or scripts that allow fir the automatic updating of the field based on these changes?

BrianHartz_Lumos_0-1747842087306.png

For example, if someone was to cut this specific segment, I would like the field to update along with it. I did have an attribute rules set in Pro, but those do not carry over. So, are there any other ideas for hosted layers?

0 Kudos
1 Solution

Accepted Solutions
EmilyGeo
Esri Regular Contributor

Hi @BrianHartz_Lumos

Yes, you can use an Arcade expression to automatically calculate the length when the feature is updated. 

  • You can start by authoring a form in Map Viewer
  • Select the field (ie Length) you want to calcuate
  • Paster or write an arcade expression to calculate that field based on the current length

The expression might look something like this: 

EmilyGeo_0-1749583084561.png

 

If you're not familiar with using arcade expressions in forms, this article is a good place to start. 

View solution in original post

0 Kudos
2 Replies
JonM32
by
Frequent Contributor

@BrianHartz_Lumos Looks like this is a hot topic in the idea community. This post shows attribute rules are wanted but not yet available in ArcGIS Online.

 

Hope this helps!

Jon M

Jon
0 Kudos
EmilyGeo
Esri Regular Contributor

Hi @BrianHartz_Lumos

Yes, you can use an Arcade expression to automatically calculate the length when the feature is updated. 

  • You can start by authoring a form in Map Viewer
  • Select the field (ie Length) you want to calcuate
  • Paster or write an arcade expression to calculate that field based on the current length

The expression might look something like this: 

EmilyGeo_0-1749583084561.png

 

If you're not familiar with using arcade expressions in forms, this article is a good place to start. 

0 Kudos