I am using Pro and Arcade scripting for creating labels. We have a field set aside for labels.
$feature.MBLABEL
The script looks like
"<fnt size= '8'>" + $feature.MBLABEL + "</fnt>"
For each and every label it works fine. However, if there is an Ampersand in the MBLABEL field it does not
Example the Text String in the field is "Cooperative Light & Power HQ"
The below image shows how it breaks the label. Removing the Ampersand fixes the issue.
Is this a known issue with Arcade?
Removing the <fnt> scripting fixes it as well. But then why bother with Arcade at all.
Solved! Go to Solution.
This is an issue with labeling in general, not in just Arcade. From the documentation:
The ampersand (&) and angle bracket (<) are special characters and are not valid in your text if formatting tags are used. Use the equivalent character codes & and < instead.
If you have special characters embedded in the values of the label field, you can replace them dynamically using a simple label script.
"<BOL>" + replace($feature.Notes, "&", "&") + "</BOL>"
This is an issue with labeling in general, not in just Arcade. From the documentation:
The ampersand (&) and angle bracket (<) are special characters and are not valid in your text if formatting tags are used. Use the equivalent character codes & and < instead.
If you have special characters embedded in the values of the label field, you can replace them dynamically using a simple label script.
"<BOL>" + replace($feature.Notes, "&", "&") + "</BOL>"
Thanks. I will use your answer.
It really does not make sense as it is part of a text string inside of an attribute.