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 / how to filter a galler...
Power Apps
Answered

how to filter a gallery excluding collection data

(0) ShareShare
ReportReport
Posted on by 8

Hi, I'm relatively new to powerapps and I'm creating an app to reserve parking spaces.

When I reserve a place, I would like that same place to stop appearing in the gallery where available places appear.

Until now, when a new reservation is created, the user first chooses the dates and at that moment I create a collection where I insert the data of the reservations that exist with those dates.

Now I want the gallery to show all the items in the list of places except the records that are in the collection (the records that have the same date)

this is where a collection is created:

TomasGomes_1-1669834918310.png

 

this is what I put in gallery; Items and the error:TomasGomes_0-1669834792870.png

 

TomasGomes_2-1669835083262.png

 

this are my lists:

TomasGomes_3-1669835201544.png

TomasGomes_4-1669835213333.png

 

 Thanks

 

 

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @TomasGomes 

    Filter(yourlistingallery, !(ID in yourcollection).ID))

     

  • TomasGomes Profile Picture
    8 on at

    TomasGomes_0-1669838055575.png

    TomasGomes_1-1669838096500.png

    thanks for your support but unfortunately didn´t work

  • Rusk Profile Picture
    1,369 Super User 2024 Season 1 on at

    Try

     

     

     

    Filter('PA007 Parking Spot', !ID in reservationsInDates)

     

     

  • TomasGomes Profile Picture
    8 on at

    TomasGomes_0-1669846319614.png

    my objective was the opposite of that, but still don´t work

  • Rusk Profile Picture
    1,369 Super User 2024 Season 1 on at

    Oops!  The ID should just be the SharePoint List ID... maybe try

    Filter(
    'PA007 Parking Spot',
    Not(Filter('PA007 Parking Spot', Title in reservationsInDates))
    )
  • TomasGomes Profile Picture
    8 on at

    TomasGomes_0-1669905819049.png

    TomasGomes_1-1669905871216.png

    still don´t work, maybe another way to exclude from the gallery the items with the same date as the selected one ?(like when the user chooses a date, reservations already made on that same date do not appear in the gallery)

  • Rusk Profile Picture
    1,369 Super User 2024 Season 1 on at

    I see the problem... the "in" operator only works on a one-column table.  What about this:

     

    Make a new column in your 'PA007 Parking Spot' list named "Reserved", default value "false"

    When you collect the items for reservationsInDates, patch the 'PA007 Parking Spot' value for this column to "true"

    Then filter 'PA007 Parking Spot' for Reserved = false

  • Verified answer
    Rusk Profile Picture
    1,369 Super User 2024 Season 1 on at

    @TomasGomes I think I got it this time:

     

    1) Add a new collection, one column only, to store the Spot (or other unique identifier).  This can be collected as the same time as your reservation.  Example: 

    Collect(reservationsInDates,{Spot: TextInput.Text, 'Date From': TextInput2.Text, 'Date To': TextInput3.Text});
    Collect(reservationsFilter,{Spot:TextInput.Text})

    2) Use that for your filter.  Example: 

    Filter(ParkingSpot,Not(Spot in reservationsFilter),Spot)

     

    Rusk_0-1669936013140.png

    In the above example, the first gallery is all the spots, which in your case I'm assuming is your 'PA007 Parking Spot' list.  Then I collected the reservation into two collections.  In your case, it would be collected in  reservationsInDates and the new one column collection.  Lastly, filter out those items in the one column collection.

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 84

#2
WarrenBelz Profile Picture

WarrenBelz 79 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 40 Super User 2026 Season 1

Last 30 days Overall leaderboard