HOW TO
ArcGIS Arcade expressions can be used in ArcGIS Dashboards to customize how the data points appear in the list element.
This article provides the steps to apply commas between two referenced field values, CITY and DISTRICT, with Arcade in ArcGIS Dashboards.
Shown below is the list element without the Arcade expression.
// Edit the desired variable name and required field name accordingly var <variableName1> = IIF(IsEmpty($datapoint.<fieldName1>), '', $datapoint.<fieldName1>) var <variableName2> = IIF(IsEmpty($datapoint.<fieldName2>), '', $datapoint.<fieldName2>) var <variableName3> = IIF((IsEmpty($datapoint.<fieldName1>)) ||(IsEmpty($datapoint.<fieldName2>)), '', ',') var <variableName4> = <variableName1> + <variableName3> + ' ' + <variableName2> return { textColor: '', backgroundColor: '', separatorColor:'', selectionColor: '', selectionTextColor: '', attributes: { <variableName4>: <variableName4> } }
The code block below demonstrates the full working expression.
// Edit the desired variable name and required field name accordingly var city = IIF(IsEmpty($datapoint.CITY), '', $datapoint.CITY) var district = IIF(IsEmpty($datapoint.DISTRICT), '', $datapoint.DISTRICT) var comma = IIF((IsEmpty($datapoint.CITY)) ||(IsEmpty($datapoint.DISTRICT)), '', ',') var location = city + comma + ' ' + district return { textColor: '', backgroundColor: '', separatorColor:'', selectionColor: '', selectionTextColor: '', attributes: { location: location } }
Shown below is the list element with the Arcade expression.
Article ID: 000030956
Get help from ArcGIS experts
Download the Esri Support App