I have an arcade expression that updates a field for polylines based on what points it intersects on another layer. I use FeatureSetByName() to find the only other layer on the map. This works in ArcGIS Pro if I use $datastore as the Feature Set Collection (first parameter).
According to the documentation, I should be able to use $map or $datastore depending on the situation. When I try to run the same expression on the webmap, $datastore returns an empty string since the Feature Set Collection is null. This is expected since the layers are not part of the same Feature Service.
However, $map does not exist in the editor and if I type it in anyway, I get the error 'Identifier not recognized.' This is what happens trying to do a field calculation.
Does $map no longer exist? I thought it would work to find other layers on the same map. Is there another way to achieve the same result?
Solved! Go to Solution.
You have to look at the Arcade profiles to see what variables are available in different circumstances. For the Field calculation profile, only $feature and $datastore are available. $map is available in other profiles, like popup or popup element.
It appears you are inside of using an Arcade profile that does not support the "$map" global. This reference is only applicable inside of Map Viewer as far as I am aware. What application are you trying to use this in?
It is a Field Calculation on Web Viewer, but according to @KenBuja, this is the Field Calculation profile.
You have to look at the Arcade profiles to see what variables are available in different circumstances. For the Field calculation profile, only $feature and $datastore are available. $map is available in other profiles, like popup or popup element.
Thanks for pointing me to Arcade Profiles, Ken. I did not know there were so many. I think it is part of the popup profile but this script works on Forms. Since the goal is to update automatically as Field Maps users make changes, I think I'm heading in the right direction.
Thanks for the help!