Background - using Dashboard and the indicator widget. When the widget has no data, the return is no data. Instead I would like to return a zero, "0". Now with Arcade ability, I thought I might be able to do this, but need your help. Here is what I have tried.
Using the below, I get "Unexpected Token If". I wonder if this is because "If" is not listed in the function list.
return {
//textColor:'',
//backgroundColor:'',
topText: If ($datapoint["sum_number_of_citations_issued"] > '0'){
return '$datapoint["sum_number_of_citations_issued"]';
} else if ($datapoint["sum_number_of_citations_issued"] < '0'){
return '0';
}
topTextColor: '#ffffff',
topTextOutlineColor: '',
topTextMaxSize: 'medium',
//middleText: '',
//middleTextColor: '',
//middleTextOutlineColor: '',
//middleTextMaxSize: 'large',
//bottomText: '',
//bottomTextColor: '',
//bottomTextOutlineColor: '',
//bottomTextMaxSize: 'medium',
//iconName:'',
//iconAlign:'left',
//iconColor:'',
//iconOutlineColor:'',
//noValue:false,
//attributes: {
//attribute1: '',
// attribute2: ''
// }
}
I also tried:
IIf($datapoint["sum_number_of_citations_issued"] < 1, '0')
and the error I get is Syntax Error: Function signature does not match; IIF
Thank you,
Annette