Hello,
I've got a list element in a dashboard that I would like to add a custom icon to if a certain data threshold has been passed. In this example it is 90 days. Currently, I have a simple DateDiff statement that displays highlighted text when the condition is met. Ideally I would like to add a custom icon instead. Wondering folks have ideas or code samples they would be able to share in order to achieve this. Code sample below and screen shots attached. Thanks!
var co = IIF($datapoint.MaintenanceIssue == 'Cleanout', "Cleanout Needed", "");
var cb = IIF($datapoint.MaintenanceIssue == 'CBMarker', "CB Marker Needed", "");
var id = IIF($datapoint.MaintenanceIssue == 'IllicitDischarge', "Illicit Discharge", "");
var sd = IIF($datapoint.MaintenanceIssue == 'OtherIssues', "Other Issues", "");
var other= IIF($datapoint.MaintenanceIssue == 'StructuralDamage', "Structural Damage", "");
var mdt = $datapoint.MaintenanceRequired
var maintDay = ''
if ((DateDiff(Today(), mdt, 'days') >= 90)){
maintDay = 'Maintenance Overdue'
} else {
maintDay= ''
}
return {
textColor: '',
backgroundColor: '',
separatorColor:'',
selectionColor: '',
selectionTextColor: '',
attributes: {
co: co,
cb: cb,
id: id,
sd: sd,
other: other,
maintDay: maintDay
}
}