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
Unanswered

How to Filter a Gallery using a Combo Box

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a basic Gallery on a screen and need to filter it based on the (possibly) multiple selections in the Combo Box control (not the drop-down). 

 

I can't find a working solution for this. Any ideas?

Categories:
I have the same question (0)
  • CarlosFigueira Profile Picture
    Microsoft Employee on at

    You can use the in operator to check if one of the properties of the element in the collection that is being filtered was selected in the combobox, using the combobox SelectedItems property. For example, if you have a combobox with the following expression for the Items element:

    ["Produce", "Dairy", "Household Items", "Bakery", "Meats", "Pantry"]

    And a data source (Products) with a column named "Department". If you want to show in a gallery the items for the selections, you can use this expression:

    Filter(Products, Department in ComboboxDepartments.SelectedItems.Value)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

     

    Thanks, Carlos, but it's not working. I might be missing something obvious. Here are the details. 

     

    This is my Combo:

    ComboBox.PNG

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    And this is my Gallery's formula on Items. The Inventory data source is a SharePoint List, and ItemType is a Choice column. 

    GalleryFilter.PNG

     

     

     

     

     

     

     

     

     

     

     

     

     

    And the resulting error:
    Formula Error.PNG

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at
    Any thoughts, this is holding up our project. Thank you for your help!
  • drawser Profile Picture
    121 on at

    Hi,

    I was having the same issue as well, after tinkering with varoius ways of doing this,

    found that the formula mentioned before works with just a bit of a minor change.

     

    You have to add .Id to Departments and change the SelectedItems.Value to

    SelectedItems.ID

     

    Filter(Products, Department.Id in ComboboxDepartments.SelectedItems.ID)

     

    At least this works on my end, my data is from SharepointLists.

  • XenophonD Profile Picture
    12 on at

    I am having the same problem and haven't seen a clear answer anywhere on this either. Anybody have any answers for this issue?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I have data in SQL Server and am using this equivilant to allow multiple selections.

     

    Filter(Products, Id in ComboboxDepartments.SelectedItems.ID)

     

  • GarrySun Profile Picture
    22 on at

    In case anyone else experience this issue, the formula should list the column name after the SelectedItems.

    Example:

    Filter(DataSource, ColumnName in ComboBox.SelectedItems.ColumnName)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    This worked great! 

     

    As a potential bonus for functionality, I set up my Gallery to change based on the search text until a user selected an item, then it switches to display only selected items:

     

    If(CountRows(ComboBox.SelectedItems) = 0 || IsBlank(ComboBox.SelectedItems) , Search(DataSource, ComboBox.SearchText, ColumnName, Filter(DataSource, ColumnName in ComboBox.SelectedItems.ColumnName))

     

    Edit: Had to add an 'Or' condition for initial loads where the ComboBox.SelectedItems is blank.

  • Aleks Profile Picture
    4 on at

    Hero, after lots of tinkering and frustration... this was exactly the thing I was looking for. 

  • aamir Profile Picture
    52 on at

    Is the IN() function giving delegate error (yellow triangle)? If so, what should be the correct comparison operator for the Combobox?

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 474

#1
Valantis Profile Picture

Valantis 474

#3
WarrenBelz Profile Picture

WarrenBelz 375 Most Valuable Professional

Last 30 days Overall leaderboard