Select to view content in your preferred language

GIS Dashboard -- Table -- Null values

210
2
Saturday
staciemaya
New Contributor

Please help. I would like to edit the code below so that cells in my table that have null values will show the word "Missing" rather than be blank. 

I assume it is this line that needs to change. "numsurcharge" is the column that occasionally has blank information that I would like to clearly identify with the word "Missing." 

displayText : Text($datapoint.numsurcharge),

Thank you! 

 
Arcade Expression for Table in GIS Dashboard: 

return {
cells: {
name: {
displayText : $datapoint.name,
textColor: '',
backgroundColor: '#ffffff',
textAlign: 'center',
iconName: '',
iconAlign: '',
iconColor: '',
iconOutlineColor: ''
},
 
numsurcharge: {
displayText : Text($datapoint.numsurcharge),
textColor: '',
backgroundColor: '#ffffff',
textAlign: 'center',
iconName: '',
iconAlign: '',
iconColor: '',
iconOutlineColor: ''
},
 
currentrenteffdate: {
displayText : Text($datapoint.currentrenteffdate),
textColor: '',
backgroundColor: '#ffffff',
textAlign: 'center',
iconName: '',
iconAlign: '',
iconColor: '',
iconOutlineColor: ''
},
 
}
0 Kudos
2 Replies
CodyPatterson
MVP Regular Contributor

Hey @staciemaya 

I think the problem is that you're not accounting for the null values in the arcade where you're displaying displayText like you mentioned. Try something like this here:

displayText : IIf(IsEmpty($datapoint.numsurcharge), "Missing", Text($datapoint.numsurcharge)),

This is just an if else statement condensed, if it is empty, then it will return Missing, else it will return the text you'd like. Let me know if that ends up working for you!

https://developers.arcgis.com/arcade/guide/logic/#iif

Cody

MiaWhite34
Emerging Contributor

 

You can modify your Arcade expression to display “Missing” whenever the numsurcharge field is null (or empty). In Arcade, you can use a conditional (IIf) to check the value. Here's the updated snippet for your numsurcharge cell:

 

 
numsurcharge: { displayText: IIf(IsEmpty($datapoint.numsurcharge), "Missing", Text($datapoint.numsurcharge)), textColor: '', backgroundColor: '#ffffff', textAlign: 'center', iconName: '', iconAlign: '', iconColor: '', iconOutlineColor: '' },
 

Explanation:

  • IsEmpty($datapoint.numsurcharge) checks if the value is null or empty.

  • IIf(condition, trueValue, falseValue) returns "Missing" if the field is empty; otherwise, it returns the actual value converted to text.

    This will ensure that any blank cells in numsurcharge now display “Missing” in your GIS Dashboard table.

  •  

0 Kudos