Skip to main content

Notifications

Power Platform Community / Forums / Building Power Apps / Multiselect Combobox/C...
Building Power Apps
Answered

Multiselect Combobox/Checkbox in 3 cascading levels

Posted on by 90

I'm trying to setup a form where users can select multiple options from CB1 leading to cascading CB2 leading to CB3, all multiple select. Data needs to submit to a SP list, preferably 3 separate columns where users should be able to filter for each value. I'm open to ideas on how to setup the data, but in my scenario, CB3 has about 100 options in total, so I was thinking along the lines of a lookup column to another SP list - but I'm open to anything that is easier. 

 

Example:

 

Combobox1 dropdown (Primary Col)Combobox2 dropdown (Secondary Col)Combobox3 dropdown (Tertiary Col)
FruitsFreshApples
VeggiesFrozenBananas
  Blueberries
  Asparagus
  Eggplant
  Spinach

 

Mapping is as below:

FruitsFreshApples
FruitsFreshBananas
FruitsFrozenBlueberries
   
VegetablesFreshAsparagus
VegetablesFreshEggplant
VegetablesFrozenSpinach

 

User should be able to select Multiple options from Combobox1, Combobox2 or Combobox3.

Ex. of my selection:

Fruits->Fresh->Apples, Bananas

Vegetables ->Fresh->Asparagus, Eggplant

Vegetables->Frozen ->Spinach

 

Combobox1, 2 and 3 need to be prompted to select something and not leave it blank. 

 

@RezaDorrani @yashag2255 @Pstork1 @PowerAddict 

Categories:
  • Re: Multiselect Combobox/Checkbox in 3 cascading levels

    Hi, So what is Result in this?

    Clear(secondaryuser);Collect(secondarytest,Ungroup(ForAll(ComboBox1.SelectedItems,Filter(list12,Primary=Result).Secondary),"Value"))

     i get an error while using this  

  • karthika89 Profile Picture
    karthika89 2 on at
    Re: Multiselect Combobox/Checkbox in 3 cascading levels

    Can you please explain how the item property has to be updated in case we have duplicate values and has to be listed in the dropdown only once.Also what has to be written in the "Update Property"

    AddColumns(RenameColumns(thirdtest,"Title","Value"),"Id",LookUp(FruitDetails,Title=Value,ID))

  • Mikello-6626 Profile Picture
    Mikello-6626 90 on at
    Re: Multiselect Combobox/Checkbox in 3 cascading levels

    Thank you so much, your solution works perfectly. 

  • Verified answer
    v-albai-msft Profile Picture
    v-albai-msft on at
    Re: Multiselect Combobox/Checkbox in 3 cascading levels

    Hi @Mikello-6626 ,

    You can think of Reset function, use this function on OnChange property of combo box based on your need. 

    For example, on DataCardValue2 control, after each change action, Reset DataCardValue3 control and DataCardValue4 control.

    v-albai-msft_1-1623736907991.png

    The only downside is that all selected options in the second and the third combo box will be clear, user need to select again). But this did work for avoiding users selecting wrong values.

    Best regards,

    Allen

     

  • Mikello-6626 Profile Picture
    Mikello-6626 90 on at
    Re: Multiselect Combobox/Checkbox in 3 cascading levels

    @v-albai-msft Hi Allen, thank you so much for getting back to me with this. I think this is working great, filtering and recording properly. The only issue I see is, when user is filling the form, if they select Fruit, Fruit type and if they delete one of the fruit choice, the associated fruit type does not get deleted and it gets submitted. In other words, while the new form is open, is it possible to dynamically eliminate FruitType_mul and FruitDetail_Mul selected choices based on Fruit if it gets changed before submitting the form - so that mismatched Fruit Type/Detail does not get submitted? Below is the problem:

     

    New form, first I select these as choices:

    Mikello-6626_0-1623690140862.png

     

    As user, before submitting I realize I make mistake in selecting fruit, so I change it to just Dairy:

    Mikello-6626_1-1623690232061.png

     

    As you can see in above, "Fresh Fruits" and "Apples" Bananas" still remain in form as valid selections. Even though if I click on dropdown, it s filtering properly. But user can make mistake and submit this form. But it will not match actual data mapping. Hope this is making sense. Any ideas to dynamically delete associated lookup values from selection and force user to submit with proper choices?

     

     

     

     

     

  • Verified answer
    v-albai-msft Profile Picture
    v-albai-msft on at
    Re: Multiselect Combobox/Checkbox in 3 cascading levels

    Hi @Mikello-6626 ,

    It is more clearly after you provide your data structure.

    Based on your current four lists, I did a test on my side for your reference.

    1. For the first combo box(called “DataCardValue2” in my form), use the default code for its Items property:

    Choices([@'Master list'].Fruit_Mul)

    v-albai-msft_0-1623311268744.png

     

    Set OnChange property of the first combo box to:

    Clear(secondarytest);Collect(secondarytest,Ungroup(ForAll(DataCardValue2.SelectedItems,Filter(FruitType,Fruit=Value).Title),"Value"))

    v-albai-msft_1-1623311268756.png

     

    Pay attention about the result format of the first combo box(because this is a lookup column in your list), the returned table has two columns: Id and Value. See below screenshot, so for other two combo box, we need to change their result to this format too, then you can save your choices into your list.

    v-albai-msft_2-1623311268760.png

     

    2. For the second combo box (called “DataCardValue3” on my side), set its Items property to:

    AddColumns(RenameColumns(secondarytest,"Title","Value"),"Id",LookUp(FruitType,Title=Value,ID))

    v-albai-msft_3-1623311268763.png

     

    Set its OnChange property to:

    Clear(thirdtest);Collect(thirdtest,Ungroup(ForAll(DataCardValue3.SelectedItems,Filter(FruitDetails,'Fruit Type'=Value).Title),"Value"))

    v-albai-msft_4-1623311268766.png

     

    3. For the last combo box, set its Items property to:

    AddColumns(RenameColumns(thirdtest,"Title","Value"),"Id",LookUp(FruitDetails,Title=Value,ID))

    v-albai-msft_5-1623311268770.png

    Check result this time.

    Best regards,

    Allen

  • Mikello-6626 Profile Picture
    Mikello-6626 90 on at
    Re: Multiselect Combobox/Checkbox in 3 cascading levels

    @v-albai-msft any assistance is appreciated

  • Mikello-6626 Profile Picture
    Mikello-6626 90 on at
    Re: Multiselect Combobox/Checkbox in 3 cascading levels

    I created 3 lookup lists instead of one because I figured that if I can just use the “Title” column from each lookup list into each combobox, I can avoid the use of Distinct. But then, how can I filter the values from one to another. I think a lookup column is making some difference and is not the same 

  • Mikello-6626 Profile Picture
    Mikello-6626 90 on at
    Re: Multiselect Combobox/Checkbox in 3 cascading levels

    @v-albai-msft I am getting kind of stuck here with multi-select lookup value. It seems like as soon as I add a Filter and Distinct function to the Items property of the comboboxes, the selected values don't get recorded in the SharePoint master list. This is my setup:

     

    Master List:

    Mikello-6626_0-1622780886141.png

    Master list column setup:

    Fruit_Mul, FruitType_Mul, FruitDetail_Mul are all lookup columns. 

    Mikello-6626_5-1622781139709.png

     

     

    Mikello-6626_3-1622781044454.png

     

    Mikello-6626_2-1622780989438.png

    Mikello-6626_4-1622781112357.png

     

    Lookup lists:

    I have 3 lookup lists - Fruit, Fruit Type, Fruit Detail

    All columns in lookup tables are Text fields

    Mikello-6626_6-1622781263929.png

    Second lookup list is Fruit Type with 2 columns: Title and Fruit

    Mikello-6626_7-1622781314110.png

    Third lookup is Fruit Detail with 3 columns: Title, Fruit, Fruit type

    Mikello-6626_8-1622781380393.png

    In Powerapps, as soon as I set Items property to Distinct(Fruits,Title) my values don't get recorded in SharePoint after submission:

    Mikello-6626_9-1622781519045.png

     

    Same problem with 2nd combobox displaying Fruit Types, both cascading and updating after submission is not working

    Mikello-6626_10-1622781728112.png

     

    Why is the multi selection value from Lookup column with Distinct/Filter functions not updating list item in SharePoint. Your help is much appreciated, Allen. 

     

  • v-albai-msft Profile Picture
    v-albai-msft on at
    Re: Multiselect Combobox/Checkbox in 3 cascading levels

    Hi @Mikello-6626 ,

    Depends on your own configuration, you need to do some edit based on my formula.

    In my example, I am using three Text columns.

    If you are using lookup columns, for example for the first combo box, you should try formula like this:

    Distinct(list12,lookup1.Value)

    Best regards,

    Allen

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Community Update Sept 16…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 140,719

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,355

Leaderboard