HOW TO
In ArcGIS Online and Portal for ArcGIS Map Viewer, when the same field value is present in multiple fields, a conditional Arcade expression can be used to display concatenating labels. In this article, the feature layer contains two fields named ‘Married’ and ‘Employed’. Using an Arcade expression, labels are created by concatenating the field names when the feature contains the ‘Yes’ field value for both fields.
The image below displays a table with the two fields and field values.
var output = ''; if ($feature['<field_name1>'] == '<field_value>'){ output = '<output1> '; } if ($feature['<field_name2>'] == '<field_value>'){ output += '<output2>' } else{ output = '<output3>' } return Trim(output);
Note: If numeric or date field values are used, remove the single quotes (' ') on <field_value>.
Note: If a different concatenating label is desired, users can configure the output statements to something other than the names of fields.
The image below displays the concatenating labels on the web map.
Article ID: 000029386
Get help from ArcGIS experts
Download the Esri Support App