Looking for an example of how to apply the advanced formatting of a Dashboard list that evaluates a string field for a comma. IF the comma exists then I need to return the background cell as red.
I've been able to get formatting working to evaluate date fields for how many days out from today but I can't seem to get anything working for my comma example. This is what I came up with based on what has worked for me in the past but the table does not get formatted and stays in the original formatting.
var gpm = $datapoint["mystringfield"];
var hasComma = Find(mystringfield, ",");
var isGreaterThanMinusOne = hasComma > -1,"#D94534";
return {
cells: {
number: {
displayText: $datapoint["number"],
textColor: '',
backgroundColor: '',
textAlign: 'left',
iconName: '',
iconAlign: '',
iconColor: '',
iconOutlineColor: ''
},
gpm: {
displayText: $datapoint["mystringfield"],
textColor: '',
backgroundColor: isGreaterThanMinusOne,
textAlign: 'left',
iconName: '',
iconAlign: '',
iconColor: '',
iconOutlineColor: ''
},
creationdate: {
displayText: $datapoint["datefield"],
textColor: '',
backgroundColor: '',
textAlign: 'left',
iconName: '',
iconAlign: '',
iconColor: '',
iconOutlineColor: ''
},
}
}