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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter Desk Booking ap...
Power Apps
Unanswered

Filter Desk Booking app by greater than or equal to todays date

(0) ShareShare
ReportReport
Posted on by 65

Hello all,


Currently have a desk booking app set up (think it's the Microsoft template app) and the gallery is set to filter the desks available on any particular day using the following formula:

 

 

Filter(
 SiteNameHere,
 !(
 Title in Filter(
 ListNameHere,
 'Booking Date' = 
 DatePickerDeskBookByDate_1.SelectedDate,
 DateTimeFormat.ShortDate
 
 ).DeskText
 )
)

 

 

This means the app is checking the entire SharePoint list, but I need to now update it so it only checks entries in the list that have a Booking Date equal to or greater than todays date, can anyone help!

 

Much appreciated for all help.

Categories:
I have the same question (0)
  • SpongYe Profile Picture
    5,603 Super User 2025 Season 2 on at

    Hi @MHSPDev 

     

    You can do this easily by checking the datepicker with the Today() function:

    Filter(
     SiteNameHere,
     !(
     Title in Filter(
     ListNameHere,
     'Booking Date' >= Today(),
     DateTimeFormat.ShortDate
     ).DeskText
     )
    )
    

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • MHSPDev Profile Picture
    65 on at

    Hi SpongYe,

    Sorry I think I must of worded this wrong!

    What I actually need is to trim down what data is being pulled into the app before it filters the desks, as there are currently 2000 items and the delegation is now causing issues within the app.

     

    I'm not sure if this requires a StartsWith function or LookUp function?

  • mmbr1606 Profile Picture
    14,605 Super User 2025 Season 2 on at

    hey @MHSPDev 

     

    you can try this:

     

    Filter(
     ListNameHere,
     'Booking Date' >= Today() && 'Booking Date' = DatePickerDeskBookByDate_1.SelectedDate
    )
    

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • MHSPDev Profile Picture
    65 on at

    Ah sorry I've been a total idiot, my original formula I put in here was wrong.

     

    I put "SiteNameHere" but it's actually two separate lists.

     

    So what we have is the below formula:

     

    Filter(
     ListofDeskNames,
     !(
     Title in Filter(
     ListContainingBookedDesks,
     'Booking Date' >= Today(),
     DateTimeFormat.ShortDate
     ).DeskText
     )
    )

     

    The ListofDeskNames is a list containing all of the desk names, e.g. Desk 1, Desk 2, Desk 3 etc.

     

    The ListContainingBookedDesks is where all of the bookings go, e.g. if I booked Desk 1 for the 15th of Feb 2024, it would create an entry in this list.

     

    What the above formula does is pulls all of the entries inside of the ListContainingBookedDesks and checks if any of the Desks from ListofDeskNames are booked on that date, and if so, hides them.

     

    The issue we are currently facing is due to there being over 2000 items, it's no longer working properly. Some desks are booked today like Desk 7, but Desk 7 is still appearing as available in the app. Whereas Desk 6 is also booked, and not appearing available in the app. This I believe is due to the app pulling in all 2300 items.

     

    What I need to do is set the formula up so when it looks at the ListContainingBookedDesks it only reads entries in from => Booking Date, meaning it only shows the Desk Names from the ListofDeskNames that are available.

     

    Below is a screenshot of the app and the list if that makes it easier to understand:

    MHSPDev_0-1708010359801.png

     

    MHSPDev_1-1708010426363.png

  • mmbr1606 Profile Picture
    14,605 Super User 2025 Season 2 on at

    try this please:

     

    ClearCollect(
     FutureBookedDesks,
     Filter(
     ListContainingBookedDesks,
     'Booking Date' >= Today()
     )
    );
    

     

    Then, for each desk in ListofDeskNames, check against FutureBookedDesks:

    ClearCollect(
     AvailableDesks,
     ForAll(
     ListofDeskNames,
     If(
     Not(Title in FutureBookedDesks.DeskText),
     Title
     )
     )
    );

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • MHSPDev Profile Picture
    65 on at

    Where am I supposed to be putting these formulas in relation to the existing filter?

     

    I know a ClearCollect has to be used with the OnSelect property in some instances, I'm but unsure where I'd use this here. I tried adding both of those formulas to the OnSelect Property of the date picker but it didn't make a difference.

     

    Thanks for the help so far!

  • mmbr1606 Profile Picture
    14,605 Super User 2025 Season 2 on at

    OnSelect of a Button or OnChange of a Date Picker:

     

    If you want the user to manually trigger the filter (e.g., by pressing a button after selecting a date), you would place the ClearCollect formula in the OnSelect property of that button. If you want the action to happen automatically when a date is selected or changed, use the OnChange property of the date picker control.

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • MHSPDev Profile Picture
    65 on at

    Ah I just changed it to the OnChange property of the date picker, I'm still getting the problem of some Desks which are already booked still appearing as available unfortunately.

     

    I just deleted a few hundred items from the list bringing it down to 1668 items and this fixed it, so the delegation limit is still causing an issue even with the ClearCollect functions set up.

     

    Is there some other way we can filter the data that is being brought into the app from the very start?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard