cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
babzi_naaz
Level: Powered On

Filter Dropdown based on another multi select dropdown

Hi,

 

I have a PowerApp in which I am using 2 dropdowns. Both dropdowns are configured as Multi select choice fields. In my first drop down following values will displayed 

 

PRO

ACT

ASSMNT

APPR

 

the second dropdown contains following values

 

PRO-NEW

PRO-RENEW

PRO-CM

ACT-NEW

ACT-ONE

ASSMNT-NEW

ASSMNT-SECOND

ASSMNT-REPEAT

APPR-FIRST

APPR-REL

 

So, when the user select one value, corresponding values needs to be filtered in the second dropdown like if I select ACT from first dropdown, second dropdown should be filtered with ACT-NEW, ACT-ONE. this is working for me by using Filter condition. But user is trying to select mutiple items from dropdown1, it should display corresponding filtered value in dropdown2 like If I secelt PRO and ACT from dropdown1 then second dropdown values should be 

 

PRO-NEW

PRO-RENEW

PRO-CM

ACT-NEW

ACT-ONE

 

Can anyone help me to sort out this. Any help or suggestions will be highly appreciated. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Filter Dropdown based on another multi select dropdown

Hi @babzi_naaz ,

Could you please share a bit more about your data source? Is it a SP list?

Could you please share more details about the Group column and SubGroup column? Are they both Choice type columns?

 

I assueme that the data source in your app is a SP List, please consider modify your formula as below:

Combobox1.Items: 

Choices('My List DS'.Group)

ComboBox1.OnChange

Clear(ComboBox2Collection);
ForAll(
       RenameColumns(ComboBox1.SelectedItems,"Value", "Value1"),
       Collect(ComboBox2Collection, Filter(Choices('My List DS'.SubGroup), StartsWith(Value, Value1)))     /* <-- Modify formula here */
)

 

ComboBox2.Items:

ComboBox2Collection

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
PavanKumar
Level 8

Re: Filter Dropdown based on another multi select dropdown

Hi,

 

For sake of simplicity Save combobox1 Selected items in a collection (on change property of combobox1 you can do this)

 

Clearcollect(colSelectedinFirst,ComboBox1.SelectedItems);

 

Now in same on change property of Combobox1 control, prepare another collection

 

ForAll( colSelectedinFirst, 
    If(CountRows(Filter(seconddatasource, StartsWith('columnnameinseconddatasource', Value))>0) 
        { 
            columnname: columnnameinseconddatasource
        } 
    ) 
)

 

if this answers your question mark it as verified and give thumbs up

Regards,

Pavan Kumar Garlapati

PavanKumar
Level 8

Re: Filter Dropdown based on another multi select dropdown

Hi,

 

For sake of simplicity Save combobox1 Selected items in a collection (on change property of combobox1 you can do this)

 

Clearcollect(colSelectedinFirst,ComboBox1.SelectedItems);

 

Now in same on change property of Combobox1 control, prepare another collection

 

ForAll( colSelectedinFirst, 
    If(CountRows(Filter(seconddatasource, StartsWith('columnnameinseconddatasource', Value))>0) 
        { 
            columnname: columnnameinseconddatasource
        } 
    ) 
)

 

if this answers your question mark it as verified and give thumbs up

Regards,

Pavan Kumar Garlapati

Community Support Team
Community Support Team

Re: Filter Dropdown based on another multi select dropdown

Hi @babzi_naaz ,

Do you want to select multiple values within the ComboBox1 and then corresponding options should be filtered within the ComboBox2?

Further, could you please share more details about the formula you typed within the two ComboBoxes in your app?

 

I have made a test on my side, please take a try with the following workaround:2.JPG

 

3.JPG

Set the Items property of the first ComboBox (ComboBox1) to following:

["PRO", "ACT", "ASSMNT", "APPR"]

Set the OnChange property of the first ComboBox to following:

Clear(ComboBox2Collection);
ForAll(
      RenameColumns(ComboBox1.SelectedItems,"Value", "Value1"),
      Collect(ComboBox2Collection, Filter( ["PRO-NEW", "PRO-RENEW", "PRO-CM", "ACT-NEW", "ACT-ONE", "ASSMNT-NEW", "ASSMNT-SECOND", "ASSMNT-REPEAT", "APPR-FIRST","APPR-REL"], StartsWith(Value, Value1)))
)

Set the Items property of the second ComboBox to following:

ComboBox2Collection

Please check the following GIF screenshot for more details:Test.gif

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
babzi_naaz
Level: Powered On

Re: Filter Dropdown based on another multi select dropdown

Hi @v-xida-msft , Thank you for your detailed reply.

 

I have updated my powerapp based on your suggestion, but I am not getting any value in the second dropdown. 

 

Here is the code I'm using in the first dropdown (it's a column from Datasource)

 

For Items Property of the Combobox1 : 

Choices('My List DS'.Group)

 in Onchnage of the Combobox1 : 

Clear(ComboBox2Collection);
ForAll(
RenameColumns(ComboBox1.SelectedItems,"Value", "Value1"),
Collect(ComboBox2Collection, Filter( SubGroup, StartsWith(Value,Value1)))
)

 

SubGroup is the Datasource column name using for second combo box

 

I used ComboBox2Collection for ComboBox2 Items property. 

 

Please correct me if I anything done wrong

Community Support Team
Community Support Team

Re: Filter Dropdown based on another multi select dropdown

Hi @babzi_naaz ,

Could you please share a bit more about your data source? Is it a SP list?

Could you please share more details about the Group column and SubGroup column? Are they both Choice type columns?

 

I assueme that the data source in your app is a SP List, please consider modify your formula as below:

Combobox1.Items: 

Choices('My List DS'.Group)

ComboBox1.OnChange

Clear(ComboBox2Collection);
ForAll(
       RenameColumns(ComboBox1.SelectedItems,"Value", "Value1"),
       Collect(ComboBox2Collection, Filter(Choices('My List DS'.SubGroup), StartsWith(Value, Value1)))     /* <-- Modify formula here */
)

 

ComboBox2.Items:

ComboBox2Collection

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

babzi_naaz
Level: Powered On

Re: Filter Dropdown based on another multi select dropdown

hi @v-xida-msft , this is worked, Thank you for the valuable suggestion.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,153)