HOW TO

Replace or omit empty attribute fields from displaying in pop-ups using a custom Arcade expression in ArcGIS Online Map Viewer

Last Published: December 23, 2021

Summary

In ArcGIS Online Map Viewer, using custom Arcade expressions is useful to differentiate specific features, for example, to give clarity to an urgent feature. It is possible to customize the display in the pop-ups by feature basis using a simple Arcade expression.

This article provides the steps to omit empty attribute fields from displaying in pop-ups or replacing the value with custom text using an Arcade expression in ArcGIS Online Map Viewer. The following procedure utilizes the logical function, IIF.

Procedure

  1. Open the web map in ArcGIS Online Map Viewer.
  2. On the Contents (left pane) toolbar, click Layers to open the Layers pane, and select the layer.
  3. On the Settings (right pane) toolbar, click Configure pop-ups.
  4. In the Pop-ups pane, under Options, click Manage expressions.
Click the Manage expressions option under Options in the Pop-ups pane.
  1. In the Pop-up expressions pane, click Add expression.
In the Pop-ups pane, click the Add expressions option to add the desired Arcade expression on the new Expression window.
  1. On the Expression window, edit the title, and click Save.
  2. In the Expression box, copy and paste either one of the following expressions. Replace $feature.name and "description" accordingly. Click OK.
Note:
If the feature is empty, a blank value is returned. If there is a value, the attribute or the "description" is returned in the expression.
IIF(isEmpty($feature.name), " ", $feature.name)
IIF(isEmpty($feature.name), " ", "description")
IIF($feature.name == " ", " ", $feature.name)
IIF($feature.name == " ", " ", "description")
Edit the title of the expression, then copy and paste the Arcade expression in the Expression box.
  1. In the Pop-ups pane, click Title and enter a title for the pop-up. Rearrange and remove fields if needed.
  2. Click Add Content > Text. On the Text window, copy and paste {expression/expr<id>}. Replace <id> accordingly. Click OK.
The Add content option is to display additional information from the newly created Arcade expression.
Copy and paste the expression id into the Text box to display it in the pop-ups.
Note:
Alternatively, click Fields list to expand the list, click Select fields to select the desired fields, and the newly created expression in step 7 to be displayed in the pop-ups. Click Done.
  1. In the Contents toolbar, click Save and open and click Save to save the pop-up changes to the map.

Article ID: 000026998

Software:
  • ArcGIS Online

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