How To: Apply Arcade expression conditional functions labeling with NULL or NOT NULL values in ArcGIS Pro
Summary
In ArcGIS Pro, Arcade conditional functions can be used to reference two or more fields of an attribute table using the Calculate tool. This improves readability of the field values, and provides uniformity, if there is a limit to the number of characters applicable.
The instructions provided describe how to use the Field Calculator in ArcGIS Pro to create a new field by referencing more than one field that has NULL or NOT NULL values in the attribute table. In this example, the COMPILE field is created by referencing field values from LEVEL, COUNTY, DISTRICT, and DIST_NO if the value in the LEVEL field is Administration.

Procedure
- Start ArcGIS Pro and open the project.
- In the Contents pane, right-click the feature class and click Attribute Table to open the attribute table.

- In the feature class attribute table, click Calculate
in the attribute table to open the Calculate Field geoprocessing tool.

- In the Calculate Field tool dialog box, configure the following parameters.
- For Field Name (Existing or New), select the available field to update the existing field. Alternatively, create a new field name.
- If a new field is created, for Field Type, select the preferred field type. Refer to ArcGIS Pro: ArcGIS field data types for more information.
- For Expression Type, select Arcade.
- Specify the following Arcade expression in the Expression section.
var <variable 1> = $feature.<field name 1> var <variable 2> = $feature.<field name 2> var <variable 3> = $feature.<field name 3> var <variable 4> = $feature.<field name 4> return When(<variable 1> == '<field value>', IIf(!IsEmpty(<variable 4>) && !IsEmpty(<variable 3>), <variable 4> + ' - ' + <variable 3>, IIf(!IsEmpty(<variable 4>), <variable 4>, IIf(!IsEmpty(<variable 3>), <variable 3>, <variable 2>) ) ), null)
Note: Refer to ArcGIS Pro: Calculate Field expressions for further information on Python expressions.
- Click OK.

Related Information
- ArcGIS Pro: Calculate Field (Data Management)
- ArcGIS Pro: Add Field (Data Management)
- ArcGIS Pro: An overview of the Fields toolset
Last Published: 5/10/2022
Article ID: 000027492
Software: ArcGIS Pro 2.9.2, 2.9.1, 2.9, 2.8.6, 2.8.5, 2.8.4, 2.8.3, 2.8.2, 2.8.1, 2.8, 2.7.6, 2.7.5, 2.7.4, 2.7.3, 2.7.2, 2.7.1, 2.7