HOW TO

Color code the background of the List element using Arcade expressions in ArcGIS Dashboards

Last Published: April 15, 2022

Summary

Arcade expressions can be used in ArcGIS Dashboards to customize how the data points appear in the list, indicator, and table elements. A data point can represent a feature or a summary statistic, depending on how the element is set up. A single data point represents a single feature when using features, and each data point represents the result of a statistic when it is used.

This article provides the steps to color code the background of the List element in ArcGIS Dashboards. In this example, the field values in the Project Status field are referenced to determine the background color for each field value in the Route Name field.

Procedure

  1. Open the ArcGIS Dashboards item. Click Layout on the dashboard toolbar, then the Options button Horizontal three dot icon next to the element. Click Configure.
The dashboard toolbar with the Layout tab
  1. Click List to open the List options menu, and click Enable.
Enabling the advanced formatting of the List element in ArcGIS Dashboards
  1. Specify the following Arcade expression in the Expression window.
// Edit the desired color accordingly
var <variableName> = Decode($datapoint["<variable>"],
'<Field value 1>', 'red',
'<Field value 2>', 'orange',
'<Field value 3>', 'yellow',
'<Field value 4>', 'green',
'')

return {
  backgroundColor: <variableName>
}
  1. Click Done.
Specifying the Arcade expression in the ArcGIS Dashboards Expression window

The image below shows the list element without the Arcade expression.

An example of the List element without the Arcade expression enabled

The image below shows the list element with the Arcade expression.

An example of the List element with the Arcade expression enabled

Article ID:000027436

Software:
  • ArcGIS Online
  • ArcGIS Dashboards

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic