custom attribute display using YEAR as part of URL

465
4
01-04-2022 08:30 AM
by Anonymous User
Not applicable

Hello,

I have a web app we've been using for years now and every year we have to go in to the URL properties of the custom attribute display and change the URL of a link to reflect the new year.

Ideally we can use the current year but I have no idea how to incorporate that as any code I try to put in the LINK properties shows up as text in the URL rather than returning the year.

Is there a way to access the current year in the URL field of a link in a custom attribute display?

In the URL below I hacked and tried adding javascript like Date.getFullYear() but it adds that to the URL string rather than running code to return current year.

KearyLarson2_0-1641313610569.png

Help is greatly appreciated.

0 Kudos
4 Replies
jcarlson
MVP Esteemed Contributor

Try creating a custom popup expression:

Year(Now())

And then piping that expression into your popup.

- Josh Carlson
Kendall County GIS
0 Kudos
by Anonymous User
Not applicable

Where do I create the custom popup expression?

0 Kudos
jcarlson
MVP Esteemed Contributor

uosl_0-1641323160413.png

Click "Add" under "Attribute Expressions" on the "configure popup" panel.

- Josh Carlson
Kendall County GIS
0 Kudos
by Anonymous User
Not applicable

Thanks. This app is currently on a server with an older version of portal and unfortunately the popup dialog doesn't show attribute expressions. That would be the way to do it though. Thank you!

 

KearyLarson2_0-1641323540689.png

 

0 Kudos