Select to view content in your preferred language

Using FeatureSetByName() $map identifier not recognized in Arcade expressions

501
4
Jump to solution
02-19-2025 11:31 AM
Labels (1)
JasonBennett
Regular Contributor

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.

JasonBennett_0-1739992925987.png

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?

0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

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.

View solution in original post

4 Replies
AustinAverill
Frequent Contributor

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?

JasonBennett
Regular Contributor

It is a Field Calculation on Web Viewer, but according to @KenBuja, this is the Field Calculation profile.

0 Kudos
KenBuja
MVP Esteemed Contributor

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.

JasonBennett
Regular Contributor

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!

0 Kudos