HOW TO

Hide a field in a pop-up using Arcade via ArcGIS Online Map Viewer Classic

Last Published: July 23, 2021

Summary

In ArcGIS Online Map Viewer Classic, descriptive information on features within a map is displayed through a pop-up. Pop-ups can display attachments, charts, images, texts, and links to external web pages. In some instances, blank or null field values are displayed in a pop-up, and these fields must be hidden. This article provides the steps to hide a field in a pop-up using Arcade via ArcGIS Online Map Viewer Classic.

Procedure

The steps below describe how to hide a field that contains an undesirable value, or a blank attribute in a pop-up.

  1. Open the map in Map Viewer Classic. Click Details, and click Contents.
  2. Create an attribute expression for the field to hide by clicking the More Options button next to the layer. Click Configure Pop-up.
The Content pane
  1. Scroll down to the Attribute Expressions section in the Configure Pop-up pane, and click ADD.
The Configure Pop-up pane
  1. Specify the IIf logical function for the field to hide. Specify None for trueValue, and inline for falseValue. The sample Arcade expression below hides the BenchLength field if the value is blank.
IIF(IsEmpty($feature.BenchLength), "None", "inline")
  1. Click OK.
The Attribute Expression dialog box and the specified IIf logical function
  1. Under the Pop-up Contents section in the Configure Pop-up pane, for Display, click A custom attribute display from the drop-down menu, and click CONFIGURE.
The Configure Pop-up pane
  1. In the Custom Attribute Display dialog box, add the other fields to be displayed in the pop-up. The image below shows the other fields to be displayed in the pop-up, using the format, Display name: {Field Name}, as shown in the following sample:
Type of amenity: {AssetTypes}
Notes: {Notes}
The Custom Attribute Display dialog box
  1. Click the View HTML Source button to switch the view to HTML Source.
The Custom Attribute Display dialog box displaying the HTML Source view
  1. Specify the following HTML code to hide a field. The expression/expr0 below refers to the ID of the previously configured attribute expression.
<br /><span style="display:{expression/expr0}">
<b>Bench length:</b> {BenchLength}<br />
</span>
  1. Click OK to close the Custom Attribute Display dialog box, and click OK once more to close the Configure Pop-up pane.
The location of the Configure Pop-up panel OK button and the Save button
  1. Click Save.

The image below demonstrates the pop-up display if the BenchLength field is not blank.

The pop-up display without a blank field value

If the BenchLength field is blank, the pop-up is displayed as shown in the image below.

The pop-up display with a blank field value

Article ID: 000025733

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