I want to be able to display a PDF link when the date (day and month) in a SharePoint list column equals today's date.
SharePoint List Example
Search list and find the file that matches today's date.
Put this code inside a button and it will provide a link to the first file matching the current date
Launch( LookUp( Sort(your_datasource_name,DayMonth,Descending), Year(DayMonth)=Year(Today()) &&Month(DayMonth)=Month(Today()) &&Day(DayMonth)=Day(Today()), FileLocation ) )
You are going to get delegation warnings here. SharePoint lists currently do not support delegation for dates (yet) so my best attempt to get around this is sorting the list by DayMonth from newest to oldest so that the most recent files come first.
To test the solution you will need the file to have a DayMonth of 12/6/2019.
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
There's two other ways to get around delegation for Dates in Sharepoint 😺
1. Create a new Sharepoint number field, call it DateNumber, make it 20191131 i.e Value(Text(DateValueThing.Text, "YYYYMMDD"))
Check against that number:
Launch( LookUp( Sort(your_datasource_name,DayMonth,Descending), DateNumber = Value(Text(Today(), "YYYYMMDD")), FileLocation ) )
2. Create and write three separate text fields for Year/Month/Day in your list, as checks against these are always delegable
Launch( LookUp( Sort(your_datasource_name,DayMonth,Descending), YearText=Text(Year(Today())) &&MonthText=Text(Month(Today())) &&DayText=Text(Day(Today())), FileLocation ) )
Always Happy to Help 🙂
Plus I deal 100% in SharePoint at the moment, so I have to be a delegation guru 😹
Great solution! Thank you.
Is it possible to do a search and ONLY compare the month/day? I am trying to make this not specific to a year. Another words, it will work each year without changing any list data.
Yes, you could remove the Year part in my second example, or set the Date format to "mmdd" and compare against that in the first example, but then you will potentially end up with multiple results being shown if there is more than one row that matches? If that's ok then try adding some test data in and see if it gives you the results you need 😺
Read the announcement for more information!
Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.
Features releasing from October 2019 through March 2020
Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications