HOW TO

Display truncated field values in a pop-up using Arcade in Map Viewer

Last Published: November 15, 2023

Summary

In ArcGIS Online and Portal for ArcGIS Map Viewer, it is sometimes necessary to display truncated field values in pop-ups for better readability.

This article provides the workflow to truncate the field values and display them in pop-ups using an Arcade expression. In this example, the field named Company contains the field values to be truncated, as shown in the attribute table below.

Table displaying the fields and the field values to be truncated

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 Enable pop-ups 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.
Text(Left($feature.<field_name>, <value>))
  1. Replace <field_name> with the name of the field containing the field values. In this example, 'Company' is used.
  2. Replace <value> with the number of characters for the field values to be truncated. In this example, ‘3’ is the value used in the expression.
Note:
The Arcade expression only displays the initial characters of the field value, and this behavior depends on the specific value used in the expression.
  1. Click Done.
Note:
Click OK in Portal for ArcGIS Map Viewer.
The Arcade expression in the editor window
  1. In the Pop-ups pane, click Fields list and click Select fields.
  2. In the Select fields pane, under Expressions, click the expression created in Step 5 to display in the pop-up.

The Map Viewer pop-up below displays the truncated field values specified to three characters.

The web map displaying truncated field values in the pop-up

Article ID: 000031415

Software:
  • ArcGIS Online
  • Portal for ArcGIS
  • ArcGIS Enterprise 11 0
  • ArcGIS Enterprise 11 1
  • ArcGIS Enterprise 11 2

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