HOW TO
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.
This article provides the workflow 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.
var <variable1> = $feature.<fieldName1> var <variable2> = $feature.<fieldName2> var <variable3> = $feature.<fieldName3> var <variable4> = $feature.<fieldName4> if (<variable1> == '<fieldValue>') { if (!isEmpty(<variable4>) && !isEmpty(<variable3>)) { return <variable4> + ' - ' + <variable3> } else if (!isEmpty(<variable4>)) { return <variable4> } else if (!isEmpty(<variable3>)) { return <variable3> + <variable2> } else { return null } }
Note: Refer to ArcGIS Pro: Calculate Field expressions for further information on Python expressions.
Get help from ArcGIS experts
Download the Esri Support App