HOW TO

Configure pop-ups to show UK date format (DD/MM/YYYY) using Arcade in Map Viewer

Last Published: December 15, 2022

Summary

The instructions in this article describe how to create an Attribute expression for your Map Viewer pop-ups which will display a date field using the UK date format (DD/MM/YYYY)

In Map Viewer Classic, it was possible to use Configure Pop-up > Configure Attributes to specify the display format for your date fields, as shown in the next image.

Configure Pop-up in Map Viewer Classic
Configure Attributes in Map Viewer Classic

This option is not present in Map Viewer, so an Attribute expression must be used instead.

 

Procedure

  1. Log in to ArcGIS Online.
  2. Navigate to Content > My Content, and select the desired feature layer.
  3. Click the Visualization tab, and click Pop-ups, as shown in the next image.
Visualization tab
  1. Click Attribute expressions > + Add expression.
Pop-ups settings

addexp.png
  1. Give the new expression a name, and enter the following Arcade code (in this example, 'date' is the name of the field which contains the dates - this should be replaced by the equivalent field name from your data)
var DD = Day($feature.date)
var months = Month($feature.date)+1
var MM = Iif(months<10,"0"+months,months)
var YYYY = Year($feature.date)

DD+"/"+MM+"/"+YYYY
  1. Click Run to check the desired output, and click Done.
adding the attribute expression
  1. Back in the Pop-ups settings pane, shown below, click Fields list > Select fields and select the newly-created Attribute expression to include it in the pop-up.
selecting the expression

tick.png
  1. Click Done then Save your pop-up changes to the feature layer. 
enabling the expression

Article ID: 000028885

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