Yesterday, someone from my team asked me whether it was possible to filter the Power Apps gallery based on multiple Combo box values. Yes, of course, achieving it is possible and very easy.
In this article, I will explain how to filter Power Apps gallery based on Combo box selection along with the topics below:
- Filter Power Apps gallery with multiple Combobox values
- Power Apps filter gallery based on Combo box multi-selected item
- Filter Power Apps gallery using Combo box allows multiple selections
Table of Contents
Filter Power Apps Gallery Based On Combo Box Selection
Let’s see how to filter a Power Apps gallery based on the combo box value with a simple scenario:
I have a SharePoint list [Loan Approval] that has various columns like:
Column Name | Data Type |
---|---|
Name | It is a default title column, I just renamed it as “Name” |
Country | Lookup |
Loan Type | Choice [“Car Loan”, “Home Loan”, “Gold Loan”] |
Loan Applied Date | Date and time |
Approved or Not | Yes/No |
Loan Handled By | Person or group |
Eligibility Provided | Choice [“Passport”, “Utility Bill”, “Voter registration card”] |
On my Power Apps screen, I have added a Combo box control and a Gallery control. The combo box is connected to a SharePoint list column [Country]. The gallery filters and displays the respective records whenever a user selects any value from the combo box control.
Follow the below steps to achieve this:
- On the Power Apps screen, insert a Combo box control -> Set its Items property to:
Distinct('Loan Approval',Country.Value)
Where,
- Loan Approval = SharePoint list name
- Country = SharePoint list column name
- Now, we want to display the SharePoint list records based on the selected value of the combo box. For that, insert aGallery control -> Set its Items property to:
Filter( 'Loan Approval', IsBlank(cmb_Country.SelectedItems.Value) || IsEmpty(cmb_Country.SelectedItems.Value) || Country.Value = cmb_Country.Selected.Value)
Where,
- Loan Approval = SharePoint list name
- cmb_Country = Combo box control name
- Country = SharePoint list lookup column
- Once your app is ready, save,publish, andpreviewit. When the user selects any value from the combo box control, the gallery will filter and display all records based on the value selected by the combo box.
This is how to filter a gallery control based on the combo box selected value in Power Apps.
Filter Power Apps Gallery Based On Multiple Combo Box Values
This section will explain how to control the gallery based on multiple combo box values.
My Power Apps screen has two Combo box controls and a Gallery control. The first combo box is connected to the SharePoint list choice column. The other combo box is connected to the same above SharePoint list person column [Loan Handled By].
Whenever a user selects a value from both combo box controls, the gallery control filters and displays only the data that matches both the selected items from the combo box controls, as shown below:
To work around this, follow the below-mentioned steps:
- On the Power Apps screen, insert a First Combo box control -> Set its Items property to:
Distinct('Loan Approval','Loan Type'.Value)
Where,
- Loan Approval = SharePoint list name
- Loan Type = SharePoint list choice column name
- Next, insert the second Combo box control -> Set its Items property to:
Distinct('Loan Approval','Loan Handled By')
Where,
- Loan Approval = SharePoint list name
- Loan Handled By = SharePoint list person column name
- We want to display the SharePoint list records based on the values selected by both combo boxes. For that, insert aGallery control -> Set its Items property to:
Filter( 'Loan Approval', (cmb_LoanType.Selected.Value in 'Loan Type'.Value && cmb_LoanHandledBy.Selected.Value in 'Loan Handled By'))
Where,
- Loan Approval = SharePoint list name
- cmb_Loan Type = 1st Combo box control name
- Loan Type = SharePoint list choice column name
- cmb_LoanHandledBy = 2nd Combo box control name
- Loan Handled By = SharePoint list person column name
- Save, Publish, and Preview the app. When the user selects a value from both combo box controls, the gallery will filter and display the data that satisfies both combo box selected items.
This is how to filter a gallery with multiple combo boxes in Power Apps.
Power Apps Filter Gallery Based On Combo Box Multiple Selected Items
I will show you how to filter a Power Apps gallery based on the multiple selected items from the combo box control.
The Power Apps screen has a Combo box control and a Gallery control. The combo box is connected to the SharePoint list choice column [Loan Type] above.
Whenever a user selects multiple values from the combo box controls, the gallery filters and displays the records based on the multiple selected values of the combo box controls.
Follow the below steps to achieve this:
- On the Power Apps screen, insert a Combo box control -> Set its Items property to:
Choices('Loan Approval'.'Loan Type')
Where,
- Loan Approval = SharePoint list name
- Loan Type = SharePoint list choice column name
- On the combo box properties pane, enable the toggle switch for Allow Multiple selection as shown below:
- We want to display the SharePoint list records based on multiple combo box-selected values. For that, insert aGallery control -> Set its Items property to:
Filter( 'Loan Approval', IsBlank(cmb_MultipleLoanType.SelectedItems.Value) || IsEmpty(cmb_MultipleLoanType.SelectedItems.Value) || 'Loan Type' in cmb_MultipleLoanType.SelectedItems)
Where,
- Loan Approval = SharePoint list name
- cmb_MutipleLoanType = Combo box control name
- Loan Type= SharePoint list choice column name
- Save, Publish, and Preview the app. When the user selects multiple values from the combo box control, the gallery will filter and display the records based on multiple selected values.
We can filter the Power Apps gallery based on the multiple selected items from the combo box control.
Power Apps Filter Gallery Using a Combo box that Allows Multiple Selections
Here, I will show you how to filter the Power Apps gallery using a combo box that allows multiple selections.
Per my SharePoint list [Loan Approval], I have a choice column [Eligiblity Provided] that allows multiple values.
Now, in my Power Apps screen, there is aCombo box controlconnected to the above SharePoint list choice column [Eligiblity Provided].
Whenever a user selects multiple values from the combo box control, the gallery should filter based on a SharePoint list of records with multiple values and display the relevant records.
To achieve it, follow the below steps:
- On the Power Apps screen, insert a Combo box control -> Set its Items property to:
Choices('Loan Approval'.'Eligibility Provided')
Where,
- Loan Approval = SharePoint list name
- Eligibility Provided = SharePoint list choice column name
- Now, we want to display the SharePoint list records based on multiple combo box-selected values. For that, insert aGallery control -> Set its Items property to:
Filter( 'Loan Approval', Concat( cmb_Eligibility.SelectedItems, Value, "," ) in Concat( 'Eligibility Provided', Value, "," ))
Where,
- Loan Approval = SharePoint list name
- cmb_Eligibility = Combo box control name
- Eligibility Provided= SharePoint list choice column name
- Save, Publish, and Preview the app. When the user selects multiple values from the combo box control, the gallery will filter and display the relevant records based on multiple selected values.
We can filter the Power Apps gallery using a combo box that allows multiple selections.
Conclusion
I hope this article helped you learn how to filter a Power Apps gallery based on a Combo box value, filter a Power Apps gallery based on multiple combo boxes, and more, with various examples.
You may also like:
- Power Apps Dropdown Values Not Showing
- Get Power Apps Combo Box Selected Value
- Populate Distinct Values in Power Apps Combo Box
Preeti Sahu
Preeti Sahu is an expert in Power Apps and has over six years of experience working with SharePoint Online and the Power Platform. She is the co-author of Microsoft Power Platform: A Deep Dive book. As a Power Platform developer, she has worked on developing various tools using Power Apps and Power Automate. She also makes Microsoft 365 videos and shares them on YouTube.