cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JC75NATS
Advocate I
Advocate I

Dynamic URL based on Date table

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
1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

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

 

 

View solution in original post

1 REPLY 1
v-xiaochen-msft
Community Support
Community Support

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

 

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,596)