Arcade Expression to populate fields from separate layers

260
2
02-06-2024 09:08 AM
Mowgli_GIS
New Contributor III

Hello, 

I have a task that I am attempting to determine if it's possible to utilize an Arcade script to accomplish, however I have limited knowledge of Arcade.  My scenario below:

I have a Utility Pole layer and a Riser layer, and the Riser layer needs to contain an ID attribute from the Pole layer on which it is snapped.  As I create a new Riser feature that is snapped to a pole feature, Is it possible to create a script that will extract the ID attribute from the pole layer and insert that ID into a field in the Riser layer?

Appreciate any any help that could be offered!

0 Kudos
2 Replies
tobeykaneseitzGIS
New Contributor

Yes - this can be accomplished with an intersect. On creation of the Riser $feature, with the attribute rule set to populate the ID field, you would look at the intersecting pole feature, and return the ID field value. 

0 Kudos
Mowgli_GIS
New Contributor III

Thank you!  Taking this a step further, is this possible in AGOL?  I don't think Attribute Rules carry over to AGOL, so I believe Arcade would likely be the route I'd need to go?

For another example, I need the Riser $feature to include a Pole Type field that calls out whether it is attached to a wood or metal pole, which the Pole $feature contains a field for Pole Type (wood or metal).  Is there an arcade expression to insert into the Riser $feature Pole Type field that will look in the Pole $feature for a Unique ID that is the same in both layers, and then add the Pole Type from the Pole Feature into the Pole Type field in the Riser feature?

Apologies if that is a bit convoluted.  I can envision what I need, but I cannot figure out how to write the script (if it's possible).

Thank you

0 Kudos