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 / Filtering Gallery with...
Power Apps
Answered

Filtering Gallery with Multiple Comboboxes

(0) ShareShare
ReportReport
Posted on by 29

Good morning! I am attempting to filter a gallery with 4 different comboboxes. One is multiselect and the other 3 are single select. I cannot for the life of me figure out how to add the other 3 single select comboboxes to the filter function. 

 

The working code I have for the multiselect combobox is listed below:

 

Filter('ListName',
Or(
    IsBlank(ComboBox1.SelectedItems),
    IsEmpty(ComboBox1.SelectedItems),
    'Column 1'.Value=Last(FirstN(ComboBox1.SelectedItems,1)).Value,
    'Column 1'.Value=Last(FirstN(ComboBox1.SelectedItems,2)).Value,
    'Column 1'.Value=Last(FirstN(ComboBox1.SelectedItems,3)).Value,
    'Column 1'.Value=Last(FirstN(ComboBox1.SelectedItems,4)).Value
    )
)
 
Any help on how to add the remaining 3 single select comboboxes would be very appreciated. Thank you in advance!
Categories:
  • charlessexton Profile Picture
    11 Super User 2024 Season 1 on at

    It would look something like this (depending on your data):

     

     

    Filter('ListName',
    Or(
     IsBlank(ComboBox1.SelectedItems),
     IsEmpty(ComboBox1.SelectedItems),
     'Column 1'.Value=Last(FirstN(ComboBox1.SelectedItems,1)).Value,
     'Column 1'.Value=Last(FirstN(ComboBox1.SelectedItems,2)).Value,
     'Column 1'.Value=Last(FirstN(ComboBox1.SelectedItems,3)).Value,
     'Column 1'.Value=Last(FirstN(ComboBox1.SelectedItems,4)).Value,
     'Column 2'.Value=Combobox2.Selected.Value
     )
    )

     

     

    The key bit is that you access the properties from your single select combobox by using combobox.Selected.COLUMN

  • BadCode Profile Picture
    29 on at

    Unfortunately this did not work. 😞

     

    Thanks.

  • charlessexton Profile Picture
    11 Super User 2024 Season 1 on at

    I showed you how to add a single select combobox to your code. What's the bit you're struggling to figure out?

  • BadCode Profile Picture
    29 on at

    I added the code for the single select combobox and when filtering it did not work. It still showed all the other options as well. For example I filtered to a certain location with the single select and the gallery still showed all the locations.

  • Verified answer
    SolTeferi Profile Picture
    on at

    Hi @BadCode ,

    Please try this. 

    Filter('ListName',
    (IsBlank(ComboBox2.Selected.Value) || 'Column 1'.Value = ComboBox2.Selected.Value) &&
    (IsBlank(ComboBox3.Selected.Value) || 'Column 1'.Value = ComboBox3.Selected.Value) &&
    (IsBlank(ComboBox4.Selected.Value) || 'Column 1'.Value = ComboBox4.Selected.Value) &&
    
    Or(
     IsBlank(ComboBox1.SelectedItems),
     IsEmpty(ComboBox1.SelectedItems),
     'Column 1'.Value=Last(FirstN(ComboBox1.SelectedItems,1)).Value,
     'Column 1'.Value=Last(FirstN(ComboBox1.SelectedItems,2)).Value,
     'Column 1'.Value=Last(FirstN(ComboBox1.SelectedItems,3)).Value,
     'Column 1'.Value=Last(FirstN(ComboBox1.SelectedItems,4)).Value
     )
    )
  • BadCode Profile Picture
    29 on at

    Duuuuuude... Thanks man, nailed it!

  • Nand_Basto Profile Picture
    64 on at

    That's Awesome buddy,

    Can you also tell me the code when I have all 4 as multi-select-ComboBoxes?

    Thanks in advance!😌

  • SolTeferi Profile Picture
    on at

    Hi @Nand_Basto ,

     

    This topic is closed. If we put multiple solutions for one topic (but, in reality for multiple cases) , it will confuse folks who search and land here to find similar solutions. So, would you please post a new topic with your question. I will try to keep an eye and give you a solution there. 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

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 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard