Hi friends!
It's pretty straightforward what I'm looking to do - I'm looking to filter a gallery tied to a SharePoint list using two multiselect combo boxes in Power Apps. Here is a screenshot of the SharePoint list:
And here is a screenshot of my PowerApp so far:
I am looking to filter the list by Division and by Site. Both columns in SharePoint are Choice columns with only one choice allowed. The choices are properly reflected in my ComboBoxes:
ComboboxCanvas2 (Filter By Division) Properties:
Items: Choices('Diverse Volunteers for Interview Panels'.Division)
IsSearchable: true
SelectMultiple: true
ComboboxCanvas3 (Filter By Site) Properties:
Items: Choices('Diverse Volunteers for Interview Panels'.Site)
IsSearchable: true
SelectMultiple: true
Based on what the user selects, I would like for my gallery to filter accordingly. For instance:
a) If no filters are applied, all items show (I have that accomplished)
b) If Crop Science and Enabling Functions are selected as filters in Division, the gallery shows all volunteers from Crop Science OR Enabling Functions
c) If US-MO-CHESTERFIELD and AUSTRALIA are selected as filters in Site, the gallery shows all volunteers located in US-MO-CHESTERFIELD OR AUSTRALIA.
If b) and c) are selected together, the list first shows volunteers in Crop Science OR Enabling Functions, then, from that filtered list, the list shows volunteers located in US-MO-CHESTERFIELD OR AUSTRALIA.
My gallery properties are as follows (methodology taken from @RezaDorrani's youtube video: Multi Select Filters in Power Apps with Combo box, Checkboxes & No Delegation):
The good news is that I have no Delegation warnings! 😄
My questions are the following:
1. How do I get the filter for Division working correctly, and
2. How do I add on the second filter to the gallery using the Site Combo Box?
Let me know if you need any additional information - thank you for your help!
Hi @jessicadduffey ,
You can do one of these with some Delegation ability as I posted, however the rest are then "local" queries on the output of the first
With(
{
_Data:
If(
Len(ClassicCombobox.Selected.Value) = 0,
'Diverse Volunteers for Interview Panels',
Ungroup(
ForAll(
ClassicCombobox.SelectedItems As _Data,
Filter(
'Diverse Volunteers for Interview Panels',
Division.Value = _Data.Value
)
),
Value
)
)
},
Filter(
_Data,
(
Len(SiteComboBox.Selected.Value) = 0 ||
Site.Value in SiteComboBox.SelectedItems
) &&
(
Len(AreaComboBox.Selected.Value) = 0 ||
Area.Value in AreaComboBox.SelectedItems
)
)
)
I suggest you use whichever one filters the most records out first.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
Hi @jessicadduffey ,
Are they single or multiple selections ?
@WarrenBelz thank you! This approach worked - I replaced with a classic combo box and am now able to filter for division! Now, a follow up question to that is - what if I wanted to insert two additional combo boxes and filter in the same manner (so the user could filter by division, site, and functional area)? I know I would need to use And/Or but if you could help me with getting that started, that would be much appreciated!
Hi @jessicadduffey ,
Firstly try a Classic ComboBox and see if that works. You can also do this (with a Classic item anyway)
If(
Len(ClassicCombobox.Selected.Value) = 0,
'Diverse Volunteers for Interview Panels',
Ungroup(
ForAll(
ClassicCombobox.SelectedItems As _Data,
Filter(
'Diverse Volunteers for Interview Panels',
Division.Value = _Data.Value
)
),
Value
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
WarrenBelz
146,651
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional