HOW TO
Custom expressions written in Arcade can be used to configure pop-ups in ArcGIS Online. These expressions can be used to generate new data with reference to a field with different values in a layer's existing fields. In some cases, multiple conditions must be set within a single logical operator, and therefore, the 'if...else if...else' logical operator can be utilized to specify the multiple conditions in the single code block.
This article provides the steps to reference values in a field and classify them using the 'if...else if...else' logical operator in ArcGIS Online Map Viewer. In this example, the value of the LEVEL_NO field is referenced to classify the marketing targets for each point symbol.
Note: More conditions and return values can be set by adding more 'else if' operators.
if ( $feature["<field name>"] == <field1>) { return "<value1>" } else if ( $feature["<field name>"] == <field2>) { return "<value2>" } else if ( $feature["<field name>"] == <field3>) { return "<value3>" } else { return "<value4>" }
The image below shows the pop-up display without the Arcade expression.
The image below shows the pop-up display with the Arcade expression.
Get help from ArcGIS experts
Download the Esri Support App