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.
- Open the map in Map Viewer Classic. Click Details, and click Contents.
- Create an attribute expression for the field to hide by clicking the More Options button next to the layer. Click Configure Pop-up.
- Scroll down to the Attribute Expressions section in the Configure Pop-up pane, and click ADD.
- 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")
- Click OK.
- 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.
- 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}
- Click the View HTML Source button to switch the view to HTML Source.
- 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>
- Click OK to close the Custom Attribute Display dialog box, and click OK once more to close the Configure Pop-up pane.
- Click Save.
The image below demonstrates the pop-up display if the BenchLength field is not blank.
If the BenchLength field is blank, the pop-up is displayed as shown in the image below.