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 / Filter to show availab...
Power Apps
Answered

Filter to show availability based on several conditions on bookings in another list

(0) ShareShare
ReportReport
Posted on by 34

Hello again

 

There is this code which removes lines from a gallery list depending if desk has been booked for that day.

 

 

Filter(
 Sort(col_Desks,Title),
 Not(
 Title in col_Reservations.DeskText
 ) && Active = 1 && Or(DeskSearchFilter.Text in Title , DeskSearchFilter.Text in Description)
)

 

 

However I want to add further conditions based on what time the desk is booked as currently if desk is booked for 1 hour (say from 10am to 11am) it'll remove the listing for that desk for the rest of the day which I don't want.

 

I need to figure out how where to place the conditions and how.

 

'startTime' and 'endTime' are variables of what time is selected for a new booking

 

'Check Out From' and 'Check Out To' are times from and to in the col_Reservations list of existing bookings. Not sure if I'm on the right lines.

 

 

'Check Out From' >= startTime && 'Check Out To' <= endTime || 'Check Out From' <= endTime && 'Check Out To' >= endTime

 

 

Active is just to say that desk is active and there is a filter on the screen so you can type desk number (via DeskSearchFilter)

Categories:
I have the same question (0)
  • Verified answer
    Rajkumar_M Profile Picture
    3,747 Moderator on at

    Hi  @rockshah 

    Try this formula,

     

    Filter(
    Sort(col_Desks, Title),
    Not(
    Title in col_Reservations.DeskText
    ) &&
    Active = 1 &&
    (DeskSearchFilter.Text in Title || DeskSearchFilter.Text in Description) &&
    IsEmpty(
    Filter(
    col_Reservations,
    (
    ('Check Out From' >= endTime && 'Check Out From' <= startTime) ||
    ('Check Out To' >= endTime && 'Check Out To' <= startTime) ||
    ('Check Out From' <= endTime && 'Check Out To' >= startTime)
    )
    )
    )
    )

    (Or)

     

    Filter(
     Sort(col_Desks, Title),
     Not(
     Title in Filter(
     col_Reservations,
     ('Check Out From' >= startTime && 'Check Out From' < endTime) ||
     ('Check Out To' > startTime && 'Check Out To' <= endTime)
     ).DeskText
     ) && Active = 1 && (DeskSearchFilter.Text in Title || DeskSearchFilter.Text in Description)
    )

     

    Thanks!

     

    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.

     

  • rockshah Profile Picture
    34 on at

    Hi @Rajkumar_404 the second option worked a treat - the only thing I had to was apply DateTimeValue to the Check Out times as they were in text format. Thanks!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 85

#2
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard