HOW TO
In ArcGIS Dashboards, the list element can display feature attributes using Arcade expressions with advanced formatting. Each list item represents a user-defined attribute referenced in the Template field. However, if a field contains null values, the associated static text still appears, resulting in blank or incomplete information, as shown in the example below.

Using the method described in How To: Hide null values or null value counts from the ArcGIS Dashboards elements removes null values entirely from the list, which may not always be the desirable. In some cases, it is preferable to retain the list structure while hiding only attributes with null values. This article provides the workflow to hide attributes for null values using advanced formatting in the ArcGIS Dashboards list elements.

Note: This Arcade expression hides a single attribute in list items when its value is null.
var <variable name> = '';
if (!IsEmpty($datapoint.<fieldName1>)) {
<variable name> = '<Attribute>'
}
return {
textColor: '',
backgroundColor: '',
separatorColor:'',
selectionColor: '',
selectionTextColor: '',
attributes: {
<yourAttributeName>: <variable name>
}
}
Below is the full working script for this example.
var title = '';
if (!IsEmpty($datapoint.Pollution_status)) {
title = 'Status:'
}
return {
textColor: '',
backgroundColor: '',
separatorColor:'',
selectionColor: '',
selectionTextColor: '',
attributes: {
status: title
}
}
{field/<fieldName2>}
{expression/<yourAttributeName>} {field/<fieldName1>}

The list element below does not display the attribute for null values.

Article ID: 000037996
Get help from ArcGIS experts
Start chatting now