cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bradweiner
New Member

Multiple Select Multi-Filter of a Collection

Hi,

 

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.

 

//ColumnA

 

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);

 

//ColumnB

 

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);

 

//ColumnC

 

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);

 

//ColumnD

 

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.

 

Thanks!

0 REPLIES 0

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,235)