HOW TO

Display concatenating labels using Arcade expression in ArcGIS Online and Portal for ArcGIS Map Viewer

Last Published: April 26, 2023

Summary

In ArcGIS Online and Portal for ArcGIS Map Viewer, it is possible to concatenate fields in a table and display the field attributes as labels using an Arcade expression. Concatenated labels are useful when displaying summarized attributes on a web map.

This article provides the workflow to concatenate two fields of the same feature layer and display them as labels using an Arcade expression. The two fields are named Street and City.

Procedure

  1. Open the web map in Map Viewer.
  2. On the Settings (light) toolbar, click Labels Labels icon. Ensure labels are enabled by toggling on the Enable labels option.
  3. In the Label features pane, click Add label class. Under Label field, click Use expression Use expression icon.
  4. In the editor window, configure the expression below. Replace <field_name1> and <field_name2> with the name of the fields which displays the concatenating labels. In this example, the Street field is used for <field_name1> and the City field is used for <field_name2>.
if (IsEmpty($feature.<field_name1>)) {
return Concatenate($feature.<field_name2>, " ");
} else {
return Concatenate([$feature.<field_name1>, $feature.<field_name2>], " ");
}
  1. Click Done in ArcGIS Online Map Viewer or OK in Portal for ArcGIS Map Viewer.
Label expression editor window

The image below displays the concatenated labels on the web map.

We map displaying concatenated labels.

Article ID: 000030033

Software:
  • ArcGIS Online
  • Portal for ArcGIS

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options