I have been trying to create an arcade expression base on the condition of an attribute. I'm on the latest 2.9.2 of ArcGIS Pro.
Here is my expression in label properties:
if(DomainName($feature, 'Private')=="Yes") {
return "<CLR red= '197', green= '0', blue='255'>"+ $feature.AssetId+ "</CLR>"
}
else {
return "<CLR red= '56', green= '168', blue='0'>" + $feature.AssetId + "</CLR>"
}
The first color is purple
The second is green
But instead, I get the actual code and not the color text I want. Plus, the colors are backward. Purple sewer cleanout should match RBG color purple for when (DomainName($feature, 'Private') == "Yes") or else when it's "No", RBG color should be green.
What am I doing wrong?
Solved! Go to Solution.
What am I doing wrong?
Remove the commas inside the CLR tag.
the colors are backward
I don't know your data structure, but from the screenshot it seems to be correct? The purple asset has an AssetID (1295), so it shows as green text. The yellow assets have AssetID "PRVT", so the labels are purple.
Maybe try using the actual field values instead of the DomainName.
What am I doing wrong?
Remove the commas inside the CLR tag.
the colors are backward
I don't know your data structure, but from the screenshot it seems to be correct? The purple asset has an AssetID (1295), so it shows as green text. The yellow assets have AssetID "PRVT", so the labels are purple.
Maybe try using the actual field values instead of the DomainName.
Thanks @JohannesLindner . Eliminating the commas worked great! I also corrected the symbology to match the colors. I had it backwards.
Thank you again! You saved me from banging my head against the wall 😉