Select to view content in your preferred language

Alternating colors in dashboard list

1235
2
Jump to solution
01-31-2022 04:29 PM
Olwyn_Bruce
Occasional Contributor

Hi there,

I have a list widget in an ArcGIS Online dashboard and I'm looking to alternate the colors of the list lines based on the ObjectID. For instance, even numbers as color 1 and odd numbers as color2.

I've tried using Boolean(oid % 2) but haven't yet had any success. I'm in the "going in circles" stage of trying to figure things out, can anyone please help me out with a snippet I can build upon?

Much appreciated.

0 Kudos
1 Solution

Accepted Solutions
JayantaPoddar
MVP Esteemed Contributor

An expression like this should work under Advanced Formatting

IIF($datapoint["OBJECTID"]%2==0,'black','gray')

 

JayantaPoddar_0-1643705119457.png

 

JayantaPoddar_1-1643705172490.png

 



Think Location

View solution in original post

0 Kudos
2 Replies
JayantaPoddar
MVP Esteemed Contributor

An expression like this should work under Advanced Formatting

IIF($datapoint["OBJECTID"]%2==0,'black','gray')

 

JayantaPoddar_0-1643705119457.png

 

JayantaPoddar_1-1643705172490.png

 



Think Location
0 Kudos
Olwyn_Bruce
Occasional Contributor

Thank you!! Works like a charm.

0 Kudos