HOW TO
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.
Expects($feature, "<field_name1>", "<field_name2>", "<field_name3>", "<field_name4>", "<field_name5>") var <variable_name> = [] for(var field in $feature) { if($feature[field] == "<field_value>"){ Push(<variable_name>, field) } } return Concatenate(<variable_name>, ", ")
Note: Click OK in Portal for ArcGIS Map Viewer.
The Map Viewer pop-up below displays the field names with the ‘Yes’ field values.
Get help from ArcGIS experts
Download the Esri Support App