Select to view content in your preferred language

Change Label Color Using Arcade Expression In ArcGIS Pro

4380
4
Jump to solution
06-02-2023 05:54 AM
ChristopherMask
Regular Contributor

The expression below does not return Funded as a color. It returns the entire string in the map: <CLR red='0' green='169' blue='120'>" +"Funded" + "</CLR . What am I missing. I would like to return different colored labels on the map for each occupancy value. Thoughts?

 

IF ($feature.Occupancy == 'Funded'){
return "<CLR red='0' green='169' blue='120'>" +"Funded" + "</CLR";}
else if ($feature.Occupancy == 'PartiallyVacantFunded'){
return 'Partially Vacant Funded';}
else if ($feature.Occupancy == 'PartiallyVacantUnfunded'){
return 'Partially Vacant Unfunded';}
else if ($feature.Occupancy == 'VacantUnfunded'){
return 'Vacant Unfunded';}
else {
return 'Unknown';
}

0 Kudos
1 Solution

Accepted Solutions
TomBole
Esri Regular Contributor

Hi @ChristopherMask 

I'm in no way an Arcade specialist, but it appears you are missing the closing ">" after CLR.

I think it should be <CLR red='0' green='169' blue='120'>" +"Funded" + "</CLR >

Hope this helps, 

Tom

View solution in original post

0 Kudos
4 Replies
TomBole
Esri Regular Contributor

Hi @ChristopherMask 

I'm in no way an Arcade specialist, but it appears you are missing the closing ">" after CLR.

I think it should be <CLR red='0' green='169' blue='120'>" +"Funded" + "</CLR >

Hope this helps, 

Tom

0 Kudos
ChristopherMask
Regular Contributor

That fixed the issue. Embarrassing 😕

 

Thank you for time @TomBole

Chris Mask

 

0 Kudos
TomBole
Esri Regular Contributor

Glad I could help. The issue was familiar because I've done the same many, many times. 

0 Kudos
JerrySneary
Regular Contributor

Erased Comment, I can't delete

0 Kudos