Select to view content in your preferred language

Dynamic current date text

594
5
10-19-2023 08:28 AM
Labels (1)
PatrickHanley1
New Contributor

Hello, 

I am trying to display a dynamic date in Experience builder in a text string. I need to label a page CURRENTYEAR+1 through CURRENTYEAR+4

I am seeing posts about doing this through the embedded content widget and HTML, but I also found ESRI documentation that they are no longer supporting <string> HTML functions which is what they suggest to get dynamic date

Any ideas?

5 Replies
ShengdiZhang
Esri Regular Contributor

Hi @PatrickHanley1 ,

You can try using an Expression in the Text widget to add dynamic content.

ShengdiZhang_0-1697768545913.png

Hope it helps,

Shengedi

0 Kudos
PatrickHanley1
New Contributor

Hi Shengedi, 

Unfortunately I dont think that will work, I believe the dynamic content in a text widget only works when referencing a layer. I am not trying to reference any layer, just need a dynamic date of the current year

0 Kudos
TimConfare2
Occasional Contributor

I need to do the same.  Have you ever found a solution to this?  Thanks

 

0 Kudos
KrystalPhaneuf4
New Contributor III

@PatrickHanley1  and @TimConfare2 I am also trying to do this. Any solutions?

0 Kudos
TimConfare2
Occasional Contributor

I ended up creating a html file with code for the current date and then embedding it where the text would be.  Let me know if you need any more info. 

0 Kudos