Hello,
I'm trying to using a single when statement to change the background color of a list element. My arcade returns no errors but work as expected. Here's my code sample:
var co = IIF($datapoint.CleanoutNeeded == 'Yes', "Cleanout Needed", "");
var cb = IIF($datapoint.CBMarkerNeeded == 'Yes', "CB Marker Needed", "");
var id = IIF($datapoint.IllicitDischarge == 'Yes', "Illicit Discharge", "");
var sd = IIF($datapoint.StructuralDamage == 'Yes', "Structural Damage", "");
var other = IIF($datapoint.OtherIssues == 'Yes', "Other Issues - see data", "");
var color = When(
$datapoint.IllicitDischarge == 'Yes', "#b51963",
$datapoint.CleanoutNeeded == 'Yes', "#c44601", '')
return {
textColor: '',
backgroundColor: '',
attributes: {
attribute1: color
},
separatorColor:'',
selectionColor: '',
selectionTextColor: '',
attributes: {
co: co,
cb: cb,
id: id,
sd: sd,
other: other
}
}
Any ideas?
Thanks,
Zac