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
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,992)