Using Arcade to Dynamicaly set Label Background Color in Web Map?

203
2
Jump to solution
04-22-2024 09:46 AM
Labels (2)
ChrisMyers_NewQuest
Occasional Contributor

Hello, 

Is it possible to use an Arcade expression to define the background color of a label based on a variable value in an AGOL web map? For example, I have a feature with a "Year" variable equal to 2020, 2021, 2022, etc. I want the background color of the label to be defined by the "Year" value. (If "Year" = 2020, back ground color = #006fde, else...)

I've messed aroung with some Arcade but haven't gotten anything to work. Just wanting to know if it's possible before I spend more time on it. 

Thanks,

Chris

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

Unfortunately, no. Arcade can't be used to access the other properties of a label class.

The best you can do is create separate label classes for each year and manually configure the color of each. Tedious, but gets the end result you want.

- Josh Carlson
Kendall County GIS

View solution in original post

2 Replies
jcarlson
MVP Esteemed Contributor

Unfortunately, no. Arcade can't be used to access the other properties of a label class.

The best you can do is create separate label classes for each year and manually configure the color of each. Tedious, but gets the end result you want.

- Josh Carlson
Kendall County GIS
ChrisMyers_NewQuest
Occasional Contributor

Thanks Josh! 

0 Kudos