I'm trying to multiple get address points that are within a parcel to show up in the parcel's pop-up window.
I got the Arcade assistant to generate some code in a simple map I made consisting of only a point and a polygon layer and it worked. When I transfer the code to a much more complicated map that I didn't create, (changing the name of the layer name and field name) I get a text execution error.
Here's the code that works:
Solved! Go to Solution.
Looking at your screenshots, it looks like the $map profile variable is not valid in this scenario. When you look at the Profile variables panel in the editor, do you see $map alongside $feature and $layer?
I have a suspicion that you may be trying to author the expression on a Map Image Layer sublayer (and not a hosted feature layer). For Map Image Layer sublayers, the $map profile variable is not supported/populated.
Are all your inputs and variables correctly spelt and you have looked for any case sensitivities?
Looking at your screenshots, it looks like the $map profile variable is not valid in this scenario. When you look at the Profile variables panel in the editor, do you see $map alongside $feature and $layer?
I have a suspicion that you may be trying to author the expression on a Map Image Layer sublayer (and not a hosted feature layer). For Map Image Layer sublayers, the $map profile variable is not supported/populated.
It is definitely an issue with the profile variable. Like @timcneil said, the $map profile variable is not available in all profiles. And it may not be obvious what profile you are using.
This concept caught me off guard and I asked the same question:
Solved: Using FeatureSetByName() $map identifier not recog... - Esri Community
This link was provided to me that shows there are many different Arcade profiles, and they don't all share the same profile variables:
Profile overview | ArcGIS Arcade | Esri Developer
@JasonBennett Did you mark @timcneil post as the answer because you are using Map Image layer sublayer.
By your reply, it seems like you are calling it an issue with the profile not having the $map variable.
But, original post says you are using a popup window and 'breaks' when you change the layer name(s).
I ask, as if not related to Map Image layer, the same $map variable should be available in the popup profile regardless of the map.
R_