Attribute Rules - Calculating values from intersecting features?

817
0
09-19-2019 01:30 PM
TylerBain
New Contributor II

I'm trying to set up some Attribute Rules to do the work that Attribute Assistant used to but it doesn't seem to have the capability. When I add a new point I want the "CITY" field to populate based on an Intersect with a Municipality feature class. I was able to get a Pop-Up configured to do this with the following expression:

var n = Intersects(FeatureSetByName($map,'Municipalities',['NAME']),$feature);for (var f in n){return f.NAME}

That worked fine. Thanks to Kelly Gerrow's post for the code.

When I go to add an Attribute Rule with the same functionality I get the error that "$map" does not exist. I cannot use $datastore in place of $map because the Municipality layer is not hosted in the same feature service as my points. It doesn't like $layer either.

Is there any way to have an Attribute Rule that calculates values from intersecting features that are in the same map but not hosted on the same feature service?

0 Replies