Showing results for 
Search instead for 
Did you mean: 
New Member

Multiple Select Multi-Filter of a Collection



I am trying to create a collection that has 4 Comboboxes that are all multiselect and based upon the selections it will filter the collection. The coding I have that is somewhat working except it is creating duplicates is as follows.




If(CountRows(comboboxA.SelectedItems)>0,ForAll(comboboxA.SelectedItems.Value As myData,Collect(colfilteredcontent,Filter(colToBefiltered,myData.Value in columnA.Value))));ClearCollect(colToBefiltered,colfilteredcontent);Clear(colfilteredcontent);




If(CountRows(comboboxB.SelectedItems)>0,ForAll(comboboxB.SelectedItems.Value As myData,Collect(colfilteredcontent,Filter(colToBefiltered,myData.Value in ColumnB.Value))));ClearCollect(colToBefiltered,colfilteredcontent);Clear(colfilteredcontent);




If(CountRows(comboboxC.SelectedItems)>0,ForAll(cbPlatformC.SelectedItems.Value As myData,Collect(colfilteredcontent,Filter(colToBefiltered,myData.Value in ColumnC.Value))));ClearCollect(colToBefiltered,colfilteredcontent);Clear(colfilteredcontent);




If(CountRows(comboboxD.SelectedItems)>0,ForAll(comboboxD.SelectedItems.Value As myData,Collect(colfilteredcontent,Filter(colToBefiltered,myData.Value in ColumnD.Value))));ClearCollect(colToBefiltered,colfilteredcontent);Clear(colfilteredcontent);


The "colfilteredcontent" is the result of the filter which is then saved to the "colToBeFiltered" for the final display. The info is filtering properly but it is also repeated the info in the final collection I want to display. I've tried both the "Distinct" and "GroupBy" functions but they case so many other issues that it won't work. Any help is much appreciated.




Helpful resources

PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (951)