Select to view content in your preferred language

Label Expression $view Identifier Not Recognized

128
3
3 weeks ago
ckellow
Occasional Contributor

Hello,

I am having an issue where I am creating an Expression for a Label of a Feature Layer within Map Viewer Classic. I am trying to have the expression change which attribute is labeled based off the map scale. However, I am running into an issue where the expression does not work because of an Execution Error - Identified Not Recognized on the $view portion of my expression. 

ckellow_0-1744129749659.png

Within the ArcGIS Arcade Documentation, it shows that $view is able to be used as a profile variable within label expressions. If that is not the case, can someone explain to me why or if there is a workaround?

Yes the expression above might be flawed in general, but that is fixable if the $view issue can be solved.

Thanks

0 Kudos
3 Replies
Noah-Sager
Esri Regular Contributor

Hi @ckellow, first, I would recommend using the Map Viewer if possible. Map Viewer Classic will be retired soon: https://support.esri.com/en-us/knowledge-base/deprecation-map-viewer-classic-deprecation-000030662

Unfortunately I don't think you are using view correctly there. Look at this doc about using view and profiles: https://developers.arcgis.com/arcade/profiles/labeling/#profile-variables
https://developers.arcgis.com/arcade/profiles/

This doc may be more helpful for configuring labels with Map Viewer: https://doc.arcgis.com/en/arcgis-online/create-maps/configure-labels-mv.htm

0 Kudos
ckellow
Occasional Contributor

Hi Noah,

Thank you. I am using the Map Viewer Classic because we have an application that is built in Web App Builder and has not been migrated fully to Experience Builder. I have taken a look at that documentation, and I also found this blog post with similar functionality for the $view.scale (though used for Symbology, not labeling).

Within that documentation, there is a variable created that is: var cs=$view.scale. This should be the same way to create the variable structure needed for the labelling I am trying to do.

Can you share more on why you think the view is used incorrectly or how you would adjust it to work properly?

0 Kudos
ckellow
Occasional Contributor

As a follow up, using the Map Viewer (new), there is no need to do what I am requesting because you can create multiple label classes for a single feature that can be set to different visibility ranges. However, for older applications the above would still need to apply for the time being.

0 Kudos