HOW TO

Hide a specific date in Portal for ArcGIS and ArcGIS Online Map Viewer pop-ups using an Arcade expression

Last Published: June 20, 2023

Summary

In Portal for ArcGIS and ArcGIS Online Map Viewer, it is sometimes necessary to hide a specific date value of a date field in the pop-up of a selected feature. This can be achieved by using the Arcade functions, IIf() and Text().

In this example, the date to be hidden is 1/1/2023. From the attribute table, the date value is only associated with the KLCC Drive line feature.

The Road June2023 attribute table with three fields.

Procedure

  1. Log in to Portal for ArcGIS or ArcGIS Online, and open the web map in Map Viewer.
  2. In Map Viewer, on the Settings (light) toolbar, click Configure pop-ups The Configure pop-ups icon.png in Portal for ArcGIS, or Pop-ups in ArcGIS Online.
  3. In the Pop-ups pane, under Fields list, click Select fields.
  4. In the Select fields pane, click Add expression.
  5. In the editor, configure the attribute expression.
IIf((Text($feature.<dateField_name>, "M/D/YY") == "<condition_date>"), "<value_if_true>", <value_if_false>)
  1. Replace <dateField_name> with the name of the date field.
  2. Replace <condition_date> with the value of the date to be hidden.
  3. Replace <value_if_true> with the value to be displayed if the date of the selected feature is the same as the specific date to be hidden. In this example, "" is used to return an empty value.
  4. Replace <value_if_false> with the value to be displayed if the date of the selected feature is not the specific date to be hidden.

This is the expression used in this example.

IIf((Text($feature.LoggedDate, "M/D/YY") == "1/1/23"), "", $feature.LoggedDate)
  1. In the editor, click Done.

The date value for the KLCC Drive line feature equals 1/1/23, so the date is not displayed in the pop-up. Otherwise, the date value in the LoggedDate field is displayed when other line features are selected.

Pop-ups displaying information of  line features in Map Viewer.

Article ID:000030739

Software:
  • Portal for ArcGIS
  • ArcGIS Enterprise 10 x
  • ArcGIS Enterprise 11 0
  • ArcGIS Online
  • ArcGIS Enterprise 11 1

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