Hello, this is my first attempt at trying to use Arcade in Operations Dashboard.
I want to change the List Item background color based on the Survey status. I'm having difficulty trying to get this Arcade code to work. See code sample and screen shots.
Code sample:
// Status of Survey entry
var color = IIF($datapoint.status == open, '#FFBEBE', '');
var color = IIF(datapoint.status == closed, '#D3FFBE','');
var color = IIF(datapoint.status == inprocess, '#BEE8FF','');
return {
textColor: '',
backgroundColor: 'color',
separatorColor:'',
selectionColor: '',
selectionTextColor: '',
// attributes: {
// attribute1: '',
// attribute2: ''
// }
}
Thanks in advance for any assistance you can provide me with. I'd like to try and change the Background color for Status - (open, closed and inprocess).
Best regards,
Colleen Madigan Schelde
Senior GIS Specialist
Radiuselnet
+45 9955 6902
Solved! Go to Solution.
On lines 2, 3 and 4 of the original code. when you want to validate if the status is open, closed or in process, you will have to enclose those values in quotes. The other change required is that you will want to not use quotes when you access the values assigned to the color variable (see line 13). In the example below I have changed the first part of the code to make it a little bit more readable.
// Status of Survey entry
var color = '';
if ($datapoint.status == 'open') {
color = '#FFBEBE';
} else if ($datapoint.status == 'closed') {
color = '#D3FFBE';
} else if ($datapoint.status == 'inprocess') {
color = '#BEE8FF';
}
return {
textColor: '',
backgroundColor: color,
separatorColor:'',
selectionColor: '',
selectionTextColor: '',
// attributes: {
// attribute1: '',
// attribute2: ''
// }
}
I'm trying to do this - Getting started with Arcade in the ArcGIS Dashboards Beta
On lines 2, 3 and 4 of the original code. when you want to validate if the status is open, closed or in process, you will have to enclose those values in quotes. The other change required is that you will want to not use quotes when you access the values assigned to the color variable (see line 13). In the example below I have changed the first part of the code to make it a little bit more readable.
// Status of Survey entry
var color = '';
if ($datapoint.status == 'open') {
color = '#FFBEBE';
} else if ($datapoint.status == 'closed') {
color = '#D3FFBE';
} else if ($datapoint.status == 'inprocess') {
color = '#BEE8FF';
}
return {
textColor: '',
backgroundColor: color,
separatorColor:'',
selectionColor: '',
selectionTextColor: '',
// attributes: {
// attribute1: '',
// attribute2: ''
// }
}
Xander -
Thanks so much for your quick response and help with my question! This is so awesome and very much appreciated. Have a great day! It works great!! 🙂
Best regards,
Colleen Madigan Schelde
Radiuselnet