Select to view content in your preferred language

Calculate a date value in a dynamic text

168
2
Jump to solution
Friday
BerendVeldkamp
Frequent Contributor

I can add the current date / time to a page layout using dynamic text, but is it also possible to add an interval to it? 

Example: I want to add the text: This map is valid until [today + 3 months]

 

I am using ArcGIS Pro 3.5

0 Kudos
1 Solution

Accepted Solutions
TomBole
Esri Regular Contributor

Hi @BerendVeldkamp 

One way you can do this is by setting up a Dynamic Text Value element with an expression.  This is outlined in the post - https://community.esri.com/t5/arcgis-pro-questions/dynamic-text-today-s-date-number-of-days/m-p/1052...

For example, using any layer (feature class or table) in the map I added the following expression:

var relDate = Now();
var end = DateAdd(relDate, 1, "month");

'This map is valid until ' + Text(end, 'M/D/Y');CurrentDatePlus1Month.jpg

Hope this helps,

Tom 

 

 

 

View solution in original post

2 Replies
TomBole
Esri Regular Contributor

Hi @BerendVeldkamp 

One way you can do this is by setting up a Dynamic Text Value element with an expression.  This is outlined in the post - https://community.esri.com/t5/arcgis-pro-questions/dynamic-text-today-s-date-number-of-days/m-p/1052...

For example, using any layer (feature class or table) in the map I added the following expression:

var relDate = Now();
var end = DateAdd(relDate, 1, "month");

'This map is valid until ' + Text(end, 'M/D/Y');CurrentDatePlus1Month.jpg

Hope this helps,

Tom 

 

 

 

BerendVeldkamp
Frequent Contributor

Thanks, I didn't know dynamic attributes were a thing, but there you go.

 

One detail: It's important to check the Distinct box, or the text will be repeated for every record in the table.

0 Kudos