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 gallery using t...
Power Apps
Answered

Filter gallery using two tables

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I've got a power app feeding off two SharePoint lists, it is used to book desks in the office. The filter on the gallery works by looking to see that the date and time does not already exist in the SharePoint list. This part is working fine.

 

I've added a combo box to use as a location field. E.g. Office 1, Office 2 and I'm trying to add this into the exiting filter code so that the gallery only shows the available desks within the selected office populated in the combo box.

 

The field with the office location is located in Desks list with bookings going into Desk Reservations list

 

I've got the following code and tried to add another Filter condition, & condition, search but I've just had no luck.

 

Any assistance on what conditions to use / how to place them in the below code would be much appreciated.

 

Filter(Desks,Not(Title in Filter(
'Desk Reservations',
CheckOutFrom >= startTime && CheckOutTo <= endTime || CheckOutFrom <= endTime && CheckOutTo >= endTime
).DeskText))

Categories:
  • Verified answer
    v-albai-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Based on your description and formula, I think your Desks.Title has same value with 'Desk Reservations'.DeskText, also startTime and endTime is two date picker controls inside your app. If I misunderstand, please let me know.

    If yes, I do a simple test on my side based on your formula, since your formula works well to return a filtered table by date, you can then add another filter() to directly filter this returned table.

    So add a combobox control called “ComboBox1”, then set Items property of gallery as below:

    Filter(Filter(
    
     Desks,
    
     Not(Title in Filter(
    
     'Desk Reservations',
    
     (CheckOutFrom >= startTime.SelectedDate&&CheckOutTo <= endTime.SelectedDate) || (CheckOutFrom >= endTime.SelectedDate&&CheckOutTo <= endTime.SelectedDate)).DeskText
    
    )),
    
    Title=ComboBox1.Selected.Value
    
    )

    Best Regards,

    Allen

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard