HOW TO

Create a dynamic date range string in an ArcGIS Pro layout using Arcade

Last Published: February 12, 2026

Summary

In an ArcGIS Pro page layout, a dynamic date range string can be used to provide context or information about the temporal extent of the data being presented. This is useful for time-aware layers or time series data.

This article describes the workflow to create a dynamic date range string in an ArcGIS Pro layout using ArcGIS Arcade.

Procedure

Note: 
A map frame must be created before adding a layout. Refer to ArcGIS Pro: Add and modify map frames for more information.
  1. Open the project in ArcGIS Pro.
  2. Add a layout to the project. Refer to ArcGIS Pro: Create a blank layout for instructions.
  3. Add table dynamic text to the layout by choosing the Table Attribute group. Refer to ArcGIS Pro: Table dynamic text for instructions.
  4. In the Insert Table Attribute window, under Source, select the layer for Table.
  5. Under Query, select Custom Query from the drop-down menu.
  6. Under Appearance, click Expression to open the Expression Builder.
  7. Insert the following expression into the Expression box. Replace <numberOfDays> with the desired number.
Note:
•  To determine the date before the current date, specify a negative number for <numberOfDays>.
•  To determine the date after the current date, specify a positive number for <numberOfDays>.
var relDate = Now();
var start = DateAdd(relDate, <numberOfDays>, "days");
var end = DateAdd(relDate, <numberOfDays>, "days");

Text(start, 'M/D/Y') + ' to ' + Text(end, 'M/D/Y');

The following code block shows the full working script.

var relDate = Now();
var start = DateAdd(relDate, -8, "days");
var end = DateAdd(relDate, -2, "days");

Text(start, 'M/D/Y') + ' to ' + Text(end, 'M/D/Y');
  1. Click OK to close the Expression Builder.
  2. Click OK to close the Insert Table Attribute window.
  3. Drag the box into the desired location to create the dynamic text element in the layout view.

The map below displays the dynamic date range string in the layout.

Article ID: 000031729

Software:
  • ArcGIS Pro

Get support with AI

Resolve your issue quickly with the Esri Support AI Chatbot.

Start chatting now

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Start chatting now

Go to download options