web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Dynamic URL based on D...
Power Apps
Answered

Dynamic URL based on Date table

(0) ShareShare
ReportReport
Posted on by 21

Hi some help please.

 

I have a button that when clicked will open a website - I want the URL to have dynamic element based on the table below.  So, if today's date was (2021-05-21) it would mean the url would be "HTTPS://WEBSITE/2021-05-20" until the next date range was reached.

 

The Table would be a list in SP, imported as a collection into the app - so as the years pass the dates would change, so solution needs to be dynamic and not require having to change code in app each month/year.

 

I have some ideas - but want it to be as simple as possible.

 

 

Effective Date - YYYY-MM-DD
2021-01-28
2021-02-25
2021-03-25
2021-04-22
2021-05-20
2021-06-17
2021-07-15
2021-08-12
And so on table as values for 2 years
Categories:
  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    HI @JC75NATS ,

     

    I did a test for you.

    1\ This is my sharepoint list.

    vxiaochenmsft_0-1631606437148.png

     

    2\ Add a button control and set its onselect property to:

    Clear(Col);ForAll(Sequence(CountRows(LIST169.Test_Date_Column)) As A,Collect(Col,{Id:A.Value,Mydate:Last(FirstN(Sort(LIST169.Test_Date_Column,Test_Date_Column,Ascending),A.Value)).Test_Date_Column}))

     

    3\ Add a label control and set its Text property to:

    If(LookUp(Col,Today()<ThisRecord.Mydate).Id<>Blank(),LookUp(Col,Id=(LookUp(Col,Today()<ThisRecord.Mydate).Id-1)).Mydate,Last(Col).Mydate)

     

    vxiaochenmsft_1-1631606499128.png

     

    Best Regards,

    Wearsky

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard