HOW TO
In ArcGIS Online Map Viewer, when a field symbolized using unique values contains null values, the null values are displayed in the Other category in the ‘Style options’ pane, as shown in the example below.

By default, null values cannot be assigned to existing or new groups, and are therefore categorized as Other in the map legend. Arcade expressions can be used to assign custom labels to null records, allowing them to be displayed as descriptive symbology instead of grouped under Other. Arcade can also treat selected non-null values as null for legend display purposes.
The legend below displays the null values in the Other category.

This article provides the workflow to customize the null value display in the map legend using Arcade in ArcGIS Online Map Viewer.
var <variable name> = $feature.<fieldName> When( <variable name> == null, '<Label>', <variable name> )
Below is the full working script for this example.
var status = $feature.status_type When( status == null, 'Undefined', status )


The Map Viewer legend below shows the null values displayed with the 'Undefined' label.

var <variable name> = $feature.<fieldName> When( <variable name> == null, '<Label>', <variable name> == '<fieldValue1>', <variable name>, <variable name> == '<fieldValue2>', <variable name>, null )
Below is the full working script for this example. In this example, the Active field value is excluded and assigned as null.
var status = $feature.status_type When( status == null, 'Undefined', status == 'Warning', status, status == 'Inactive', status, null )


The Map Viewer legend below shows the null values displayed with the 'Undefined' label and the non-null values grouped as null values in the Other category.

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