Select to view content in your preferred language

Conditional Text Formatting in Operations Dashboard List

7299
10
02-04-2020 10:44 AM
JasonCyphers
Frequent Contributor

Is it possible to format text in an operations dashboard's list, via html, based on an attribute value?  I know it can be done in webdesign through php or css files, but am not sure how limited it is in this environment.

I have a list of feature attributes, and one of those attributes is "status".  Is it possible to use some sort of conditional formatting to change the text's color based on the status attribute, something like if {status} = "In Design", make the font color pink; if {status} = "In Progress", make the font color green; if {status} = "Complete", make the font color red... so it'd look like this:

   Project Name: XYZ Subdivision

   Description: Install underground utilities

   Project Status: Complete

   Project Name: ABC Subdivision

   Description: Install underground utilities

   Project Status: In Design

   Project Name: 123 Main St.

   Description: Install underground service

   Project Status: In Progress

I've seen ways to do it with an additional attribute field of an html color code that then colors the cell in the list with that color, but I also seem to remember reading that auto-updates don't work; so if I were to come back and change the status of a feature I'd also have to change the html color manually...it wouldn't do it automatically.

Hopefully all that makes sense...

10 Replies
ChrisPetzold
New Contributor

I used a Survey123 domained feature class with coded values. The label for my responses was Red, Green and Blue for my 'Favorite Color' field and the values for each were coded as the hex values for the colors I wanted represented.  It turned out to look like this in my Dashboard list (I was just using edited date as my return just so I could have an output):

(Ignore the first 6 entries, those were test values...third time's a charm!)

<h3 style="color:{favorite_color}"><strong>{EditDate}</strong></h3>

Hope this helps.