Select to view content in your preferred language

Can you change the font color by dynamic data?

2868
6
08-20-2020 02:14 PM
ChristenWatts
Occasional Contributor

I am building out some cards, and using the Dynamic Text feature, is it possible to build an expression that would do an If, Else with the dynamic data?  I'd like to color code the data by the attribute.  So If Status is "green" then the font color would be green.  Is something like this possible?  Thanks for your help!

6 Replies
ShengdiZhang
Esri Regular Contributor

Hi Christen,

Currently there may not a better way to do this than manullay changing the font color, but we'll look into this.

Thank you,

Shengdi

CalebAnderson
Occasional Contributor

@ChristenWatts, did you find a solution for this. I have a very similar scenario, thanks! -Caleb

0 Kudos
ChristenWatts
Occasional Contributor

Hey @CalebAnderson  no, I didn’t figure it out. Let me know if you do!!

0 Kudos
CalebAnderson
Occasional Contributor

Thanks @ChristenWatts. It's not as elegant as being able to do this directly within a text box but one of our GIS developers, @PeterDalrymple,  pointed out that by referencing the web map within exp. builder, the 'feature info' widget passes in the pop-up from the web map. If a custom HTML pop-up is built using arcade expressions for changing color, this carries through into exp. builder. It's a different application concept than yours but I can share the link once complete if you're interested.

ChristenWatts
Occasional Contributor

Oh that’s really smart. I love arcade. Thanks for the great idea. 

0 Kudos
ShengdiZhang
Esri Regular Contributor

The text widget supports dynamic styles in the June 2025 AGOL release. These styles will be set on the entire widget content.

If you only want part of the content to use a dynamic style, you can insert an Arcade expression into the text.

For more information, please visit https://doc.arcgis.com/en/experience-builder/latest/configure-widgets/advanced-formatting.htm#ESRI_S... 

Thanks,
Shengdi

0 Kudos