HOW TO
Arcade conditional functions are useful in field calculations to generate attribute values based on specific conditions. A field can be populated based on the attributes of other fields that hold either NULL or NOT NULL values to organize and prevent invalid records.
This article describes the workflow to apply Arcade conditional functions to NULL or NOT NULL values in ArcGIS Online by performing a field calculation. In this example, the attributes are populated in the Compile field by referencing field values from Type, SchoolID, District, and City (if the type is Public).
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 <variable2> + ', ' + <variable3> } else { return null } }
Article ID: 000032370
Get help from ArcGIS experts
Download the Esri Support App