Summary
In ArcGIS Online or Portal for ArcGIS, when the same field value is present in multiple fields, a conditional Arcade expression can be used to display the field names in pop-ups. This method is useful when intending to display precise pop-up results.
In this article, the feature layer contains five fields named, Corn, Oats, Barley, Wheat, and Soybeans. The workflow provided displays the field names in the pop-ups when the feature contains the ‘Yes’ field value for the five fields in ArcGIS Online or Portal for ArcGIS Map Viewer.
The table below displays the five fields and its field values to be displayed in the pop-ups.
Procedure
1. Open the web map in Map Viewer.
2. In the Layers pane, select the layer. In this example, a polygon layer named ‘Plantation’ is used.
3. On the Settings (light) toolbar, click Pop-ups. Ensure pop-ups are enabled by toggling the Enable pop-ups option on.
4. In the Pop-ups pane, create an Arcade expression to display the field names in the pop-ups. Refer to ArcGIS Online: Use expressions or Portal for ArcGIS: Use expressions for instructions.
5. In the editor window, configure the expression below.
A. Replace,,,, andwith the name of the fields containing the field values. In this example, the field names are Corn, Oats, Barley, Wheat, and Soybeans.
B. Replaceandwith the desired attribute value. In this example, ‘Yes’ is used.
6. Click Done.
7. In the Pop-ups pane, click Fields list and click Select fields.
8. In the Select fields pane, under Expressions, click the expression to display in the pop-up.
The Map Viewer pop-up below displays the field names with the ‘Yes’ field values.