web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Combine multiple combo...
Power Apps
Unanswered

Combine multiple combo box selections

(0) ShareShare
ReportReport
Posted on by
Dear community
 
I have a combobox which is single select
 
Items property- works fine
Sort(Distinct(Filter(ProductLineCategories,'Product Line Category'= DataCardValue11.Selected.Value),'Parent Category'),
Value,SortOrder.Ascending)
 
I now change it to multiselect and able to select but the dependent dropdown category does not correctly show filtered values from multiple selected filters. Also distinct values are not shown.
 
//Items property
RenameColumns(ShowColumns(Filter(ProductLineCategories, 'Parent Category' = DataCardValue8.Selected.Value),"ID","Category"),"ID","Id","Category","Value")
 
 
//Patch function on button submit
 
Patch(Inventions,
         ThisItem,
        {
            ProductLine:{
                Id:DataCardValue10.Selected.ID,
                Value:DataCardValue10.Selected.'Product Line'
                     },
            ProductLineCategory:{
                Id:LookUp(ProductLineCategories,'Product Line Category' =DataCardValue11.Selected.Value).ID,
                Value:DataCardValue11.Selected.Value
           },
           ParentCategory:{
                Id:LookUp(ProductLineCategories,'Parent Category' =DataCardValue8.Selected.Value).ID,
                Value:DataCardValue8.Selected.Value
           },   
            Category: DataCardValue9.SelectedItems
       }
);
Categories:
I have the same question (0)
  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @Vaibhav_k - looking at your Patch statement, I think I am correct in assuming the Product Line and ProductLineCategory fields are SharePoint LookUp/Choice data types.

     

    To Filter a single-select ComboBox based on the selected items in a multi-select ComboBox, you can use:

     

    Sort(
     Distinct(
     Ungroup(
     ForAll(
     DataCardValue11.SelectedItems As _selection,
     Filter(
     ProductLineCategories,
     _selection.Value exactin 'Product Line Category'.Value
     )
     ),
     "Value"
     ),
     'Parent Category'.Value
     ),
     Value,
     SortOrder.Ascending
    )

     

     

    Note that the Distinct, UnGroup, ForAll and In functions are not delegable.

  • Vaibhav_k Profile Picture
    on at

    Hi @Amik this formula isnt displaying any values in combo box now. Correct this is lookup column. Earlier top 2 levels were single selection and 3rd was multi selection . Now second and third should be multi select.

  • Vaibhav_k Profile Picture
    on at

    Hi @Amik , 

     

    //below works but gets multiple repeated values as choices. I want to get distinct

    Sort(
        Distinct(
            Ungroup(
                ForAll(
                    DataCardValue11.SelectedItems As _selection,
                    Filter( ProductLineCategories, _selection.Value exactin 'Product Line Category')
                ),
                "Value"
            ),
            ParentCategory
        ),
        Value,
        SortOrder.Ascending
  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @Vaibhav_k - your first post stated you have a dropdown control which displays filtered results based on a single selection from a Combo Box control. I understood you changed the Combo Box to allow for multiple selections and that you want the dropdown control to filter on those selections.

     

    After providing you with a solution, you have now decided to mention you have three dropdown controls/combo boxes.

     

    I am no longer clear on what you're trying to do.  I suggest you provide full context and a better explanation (I do not know your app).

  • Vaibhav_k Profile Picture
    on at

    Hi @Amik sorry for confusion. First one is single select lookup column, second dependent combo box is multi select look up column relies on first. 3rd multi select lookup combo box relies on second.  First one items 

    Sort(Distinct(ProductLineCategories, 'Product Line Category'), Value, SortOrder.Ascending)

    Second combo box 

     

    Sort(
        Distinct(
            Ungroup(
                ForAll(
                    DataCardValue11.SelectedItems As _selection,
                    Filter( ProductLineCategories, _selection.Value exactin 'Product Line Category')
                ),
                "Value"
            ),
            ParentCategory
        ),
        Value,
        SortOrder.Ascending
     
    Category combo box
     
    RenameColumns(ShowColumns(Filter(ProductLineCategories, 'Parent Category' = DataCardValue8.Selected.Value),"ID","Category"),"ID","Id","Category","Value")

    In patch,

     

    Patch(Inventions,
     ThisItem,
     {
     ProductLine:{
     Id:DataCardValue10.Selected.ID,
     Value:DataCardValue10.Selected.'Product Line'
     },
     ProductLineCategory:{
     Id:LookUp(ProductLineCategories,'Product Line Category' =DataCardValue11.Selected.Value).ID,
     Value:DataCardValue11.Selected.Value
     },
     ParentCategory:{
     Id:LookUp(ProductLineCategories,'Parent Category' =DataCardValue8.Selected.Value).ID,
     Value:DataCardValue8.Selected.Value
     }, 
     Category: DataCardValue9.SelectedItems
     }
    );

     now second combo box parent category shows multiple repeated values. also values in SharePoint for parent category are not stored.

  • Vaibhav_k Profile Picture
    on at
    Dear Community, I managed patch using below. I keep getting repeated values.
    But when I use Distinct additionally, I get error in patch function that it expects different table schema.  I am stuck here.
     
    //Items                                                                                                                                                                                                                  RenameColumns(
        ShowColumns(
            Filter(
                ProductLineCategories,
                'Product Line Category' = DataCardValue11.Selected.Value
            ),
            "ID",
            "ParentCategory"
        ),
        "ID",
        "Id",
        "ParentCategory",
        "Value"
    )                                                                                                                                                                                                                                                                                     
     
                                                                                                                                                                                                                                                                                                                                                                                                       //Patch                                                                                                                                                                            Set(itemID,SharePointIntegration.SelectedListItemID);
    Patch(Inventions,
             LookUp(
            Inventions,
            ID=itemID
        ),
            {
                ProductLine:{
                    Id:DataCardValue10.Selected.ID,
                    Value:DataCardValue10.Selected.'Product Line'
                         },
                ProductLineCategory:{
                    Id:LookUp(ProductLineCategories,'Product Line Category' =DataCardValue11.Selected.Value).ID,
                    Value:DataCardValue11.Selected.Value
               },  
             
     
                            ParentCategory: ForAll(
                        DataCardValue8.SelectedItems,
                        {
                        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
                        Id: Id,
                        Value: Value
                        }
                        ),
                           
                            Category: DataCardValue9.SelectedItems
               
           }
    );          
  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @Vaibhav_k - 

     

    It is always better to provide clear context and an explanation of what you're trying to do, rather than asking for help on fixing your solution.

     

    As I understand it.

     

    You have a SharePoint list which has three LookUp columns (ProductLine,  ParentCategory, Category).

     

    In SharePoint, ProductLine has been configured as a single-select LookUp column, and ParentCategory and Category have been configured as multi-select LookUp columns.

     

    You have an EditForm control in your screen. The data source is associated to your SharePoint list.

     

    In your Form, you have a ComboBox (ComboBox1) which returns the values in "ProductLine" field. In your app, this CombBox has been configured as single-select. I would assume the items property is:

     

    Choices([@'ProductLineCategories'].ProductLine)

     

     

    In your Form, you have another Combobox (ComboBox2) which returns the values in the "ParentCategory" field. The items in this control should return any values associated to the single selected item in ComboBox1. In your app, ComboBox2 has been configured as a multi-select ComboBox.

     

    In your Form, you have a third Combobox (ComboBox3) which returns the values in the "Category" field. The items in this control should return the any values associated to the selected items in ComboBox2. In your app, ComboBox3 has also been configured as a multi-select ComboBox.

     

    You then want to save the selected item from ComboBox1, and the selected items from ComboBox2 and ComboBox3 into each relevant LookUp field in your SharePoint list.

     

    Confirm the above is correct or not, and then I can provide you with a solution.

  • Vaibhav_k Profile Picture
    on at

    @Amik this is correct context. 

  • Ami K Profile Picture
    15,687 Super User 2024 Season 1 on at

    @Vaibhav_k - 

     

    I can only provide you with the way I would do it, rather than troubleshooting whatever method you have used.

     

    For a start, my preference is not to use the Patch function but instead modify the properties of your ComboBox controls, then leverage the SubmitForm function to update the output of those controls.

     

    There are a number of steps involved and I have outlined them in the below blog post:

     

    https://powerusers.microsoft.com/t5/Power-Apps-Community-Blog/Submit-cascading-multi-select-SharePoint-LookUp-columns-using-an/ba-p/2623428 

     

    Because these instructions will need to be followed explicitly, I would strongly suggest you create a new Screen, with a new Gallery and a new Form for testing. This way you can troubleshoot any potential errors which could occur, without worrying about any existing modifications you have made to your current setup. It will also help you understand what is going on, and then apply the same logic to your actual setup.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 408

#2
timl Profile Picture

timl 340 Super User 2026 Season 1

#3
Vish WR Profile Picture

Vish WR 319

Last 30 days Overall leaderboard