Select to view content in your preferred language

Arcade Text Color Dashboards List

814
2
Jump to solution
11-01-2023 12:13 PM
MelanieBass
Occasional Contributor

I have been struggling with what I thought was simple code for my list element in the dashboard. I just want the List element to show red when a particular date is shown: "December 29, 1899". I have reviewed other posts on this same thing and I can't get it to change at all. I have clicked from the globals and changed from this format for the $datapoint to the $datapoint["DateInspected"]. Nothing seems to work. I appreciate any insight. 

MelanieBass_0-1698865897905.png

 

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

The value of DateInspected isn't just the date. It will contain the time and time zone information. If you just want the Date , you can format it using the Text function for your When statement.

var color = When(Text($datapoint.DateInspected, 'MMMM D, Y') =='December 29, 1899', '#FF0000', '#000000');
return {
  textColor: color,
  backgroundColor: '',
  separatorColor:'',
  selectionColor: '',
  selectionTextColor: '',
  // attributes: {
    // attribute1: '',
    // attribute2: ''
  // }
}

 This example will give you red text for the items that are on that date.

dash.png

View solution in original post

2 Replies
KenBuja
MVP Esteemed Contributor

The value of DateInspected isn't just the date. It will contain the time and time zone information. If you just want the Date , you can format it using the Text function for your When statement.

var color = When(Text($datapoint.DateInspected, 'MMMM D, Y') =='December 29, 1899', '#FF0000', '#000000');
return {
  textColor: color,
  backgroundColor: '',
  separatorColor:'',
  selectionColor: '',
  selectionTextColor: '',
  // attributes: {
    // attribute1: '',
    // attribute2: ''
  // }
}

 This example will give you red text for the items that are on that date.

dash.png

MarkDuvall_ccec
Emerging Contributor

I had a similar issue that I've been trying solve for weeks with no luck. This worked perfectly!

Thank you!

0 Kudos