cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Allow a single dropdown field to be dependent on values selected from other dropdown(s) fields

On my powerApps, I'm looking to create a Nested (Three-way) drop down cascading list

 

For Example:

Dropdown Field: Brands: Dropdown that allows multi-Select (There are about 5 values)

 

Dropdown Field(s): PartnerShip: Dropdown that allows single-Select, these are hidden drop-downs that are displayed based on the corresponding brands that are shown. If 3 Brands (Values) are selected from the previous field, the powerApps form displays the three corresponding fields for the value selected.

 

1 Dropdown Field: Multi-Select dropdown value that displays ALL corresponding values based on the various previous field(s) (PartnerShip values) that were selected

 

Use case:

Field 1: Nike, Reebok, Puma

 

Field 2,3,4: Since we selected three brands we have three fields and say we select a shoe model for each of the three field ( Nike Revolution 5, Reebok Airs, Puma marathon)

 

Field 6: This will display ALL the corresponding values from fields 2, 3, 4 in a single list, where the user is able to select multiple values

 

 

Is this something that is possible? If so would I create the list along with what changes I'd make to the data-card

13 REPLIES 13
TheRobRush
Super User
Super User

I set a button to start a collection for me. That button has the following in it's OnSelect

 

Collect(ShoeExample,
        {Company:"ShoeGiant1", 
         Nested:
                Table(
                    {Shoes:"Shoe1"},
                    {Shoes:"Shoe2"},
                    {Shoes:"Shoe3"},
                    {Shoes:"Shoe4"},
                    {Shoes:"Shoe5"}
                    )
        },        
        {Company:"ShoeGiant2", 
         Nested:
                Table(
                    {Shoes:"Shoe6"},
                    {Shoes:"Shoe7"},
                    {Shoes:"Shoe8"},
                    {Shoes:"Shoe9"},
                    {Shoes:"Shoe10"}
                    )
        },        
        {Company:"ShoeGiant3", 
         Nested:
                Table(
                    {Shoes:"Shoe11"},
                    {Shoes:"Shoe12"},
                    {Shoes:"Shoe13"},
                    {Shoes:"Shoe14"},
                    {Shoes:"Shoe15"}
                    )
        },        
        {Company:"ShoeGiant4", 
         Nested:
                Table(
                    {Shoes:"Shoe16"},
                    {Shoes:"Shoe17"},
                    {Shoes:"Shoe18"},
                    {Shoes:"Shoe19"},
                    {Shoes:"Shoe20"}
                    )
        },        
        {Company:"ShoeGiant5", 
         Nested:
                Table(
                    {Shoes:"Shoe21"},
                    {Shoes:"Shoe22"},
                    {Shoes:"Shoe23"},
                    {Shoes:"Shoe24"},
                    {Shoes:"Shoe25"}
                    )
        })

In other words I have a collection, or a data source (you can set a list up like this as well) that contains 5 shoe companies, and a nested table for each of them containing 5 shoes each.

 

Below this I place 3 combo boxes.

First combo box has a items property of

ShoeExample

and an OnChange property of

///CYCLE THROUGH COMPANIES AND SEPERATE THE NESTED TABLES TO RETURN ALL OF ITS SHOES IN A LIST 
    Clear( itemTable);     
    ForAll(Self.SelectedItems.Nested As itemtype,
           Collect(itemTable,itemtype.Nested.Shoes));

This just goes through your selected companies one at a time, and collects all the shoes attached to them

 

Second combobox has a items property of

itemTable

 

This is collection made in the onchange of first combobox and will contain only the shoes from the selected companies.

 

Final combobox will simply have a items property of

ComboBox4_1.SelectedItems.Shoes

containing only the shoes selected in the second combobox.

 

My three comboboxes in example were named combobox4 combobox4_1 & combobox4_2

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!
RandyHayes
Super User
Super User

@TheRobRush 

Commenting here as I followed your link in another post to this.

 

Another option on this is way simpler...and more "PowerApps-like"

 

Combobox1 Items property:

Table(
    {Company:"ShoeGiant1", Nested: RenameColumns(["Shoe1", "Shoe2","Shoe3","Shoe4","Shoe5"], "Value", "Shoes")},
    {Company:"ShoeGiant2", Nested: RenameColumns(["Shoe6", "Shoe7", "Shoe8", "Shoe9", "Shoe10"], "Value", "Shoes")},
    {Company:"ShoeGiant3", Nested: RenameColumns(["Shoe11", "Shoe12", "Shoe13", "Shoe14", "Shoe15"], "Value", "Shoes")},
    {Company:"ShoeGiant4", Nested: RenameColumns(["Shoe16", "Shoe17", "Shoe18", "Shoe19", "Shoe20"], "Value", "Shoes")},
    {Company:"ShoeGiant5", Nested: RenameColumns(["Shoe21", "Shoe22", "Shoe23", "Shoe24", "Shoe25"], "Value", "Shoes")}
)

 

Combobox2 Items property:

Ungroup(Combobox1.SelectedItems.Nested, "Nested")

 

No heavy-weight collections or "program-like" actions needed!

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Excellent change, nice work

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!

@RandyHayes curious what is the purpose in adding rename columns bit to the table? Also tried your method on second combobox but using my original layout

 

Table(
        {Company:"ShoeGiant1", 
         Nested:
                Table(
                    {Shoes:"Shoe1"},
                    {Shoes:"Shoe2"},
                    {Shoes:"Shoe3"},
                    {Shoes:"Shoe4"},
                    {Shoes:"Shoe5"}
                    )
        },        
        {Company:"ShoeGiant2", 
         Nested:
                Table(
                    {Shoes:"Shoe6"},
                    {Shoes:"Shoe7"},
                    {Shoes:"Shoe8"},
                    {Shoes:"Shoe9"},
                    {Shoes:"Shoe10"}
                    )
        },        
        {Company:"ShoeGiant3", 
         Nested:
                Table(
                    {Shoes:"Shoe11"},
                    {Shoes:"Shoe12"},
                    {Shoes:"Shoe13"},
                    {Shoes:"Shoe14"},
                    {Shoes:"Shoe15"}
                    )
        },        
        {Company:"ShoeGiant4", 
         Nested:
                Table(
                    {Shoes:"Shoe16"},
                    {Shoes:"Shoe17"},
                    {Shoes:"Shoe18"},
                    {Shoes:"Shoe19"},
                    {Shoes:"Shoe20"}
                    )
        },        
        {Company:"ShoeGiant5", 
         Nested:
                Table(
                    {Shoes:"Shoe21"},
                    {Shoes:"Shoe22"},
                    {Shoes:"Shoe23"},
                    {Shoes:"Shoe24"},
                    {Shoes:"Shoe25"}
                    )
        })

 

as well as your layout minus rename

 

Table(
    {Company:"ShoeGiant1", Nested: ["Shoe1", "Shoe2","Shoe3","Shoe4","Shoe5"]},
    {Company:"ShoeGiant2", Nested: ["Shoe6", "Shoe7","Shoe8","Shoe9","Shoe10"]},
    {Company:"ShoeGiant3", Nested: ["Shoe11", "Shoe12","Shoe13","Shoe14","Shoe15"]},
    {Company:"ShoeGiant4", Nested: ["Shoe16", "Shoe17","Shoe18","Shoe19","Shoe20"]},
    {Company:"ShoeGiant5", Nested: ["Shoe21", "Shoe22","Shoe23","Shoe24","Shoe25"]})

 

and ofcourse your version with the rename.

 

All three seem to work with your code in the second dependant combo box,

Ungroup(ComboBox.SelectedItems.Nested, "Nested")

 

So for future reference, is there a benefit to using any of the three source table formats over the other, or are they all more or less the same, and the real meat & potatoes is in the setup of that second combobox with the above items property?

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!
RandyHayes
Super User
Super User

@TheRobRush 

So, there is actually a difference between all three!

In the first table you showed, the table has a schema of a record with a Company and Nested columns.  The Nested column has a schema of a column call Shoes

 

In your second table, you have changed the schema and the Nested schema has changed.  There is no longer a Shoes column but instead a Value column.

 

The ["...", "...."] syntax will always create a Table that has a column called Value.

It is much simpler than typing Table({Value:"..."}, {Value:"..."})

Both would produce the same table.

 

But that is not really relevant to the "simplicity" part of my response before, the data sample of combobox 1 was just for example anyway.  So to keep the Schema identical, I did the shorthand method of creating the Nested Table.  And, since that produces a column called Value...I just used renameColumns to rename it to Shoes to keep the schema identical to your example data.

 

The distinction comes in with what was NOT included in my response.  

IN your original response you stated the Final list would be:

ComboBox4_1.SelectedItems.Shoes

 

SO, with the second table structure you stated above, the above formula would not be valid - it would have to be this instead:

ComboBox4_1.SelectedItems.Value

 

But again, these little things in the sample data were not all that spectacular as much as just the elimination of a collection, and a formula in OnChange.  It was more to just show that all of those selected items with nested table columns can be combined with the Ungroup function...another powerful function for data shaping in PowerApps!

😁

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Excellent Ok great explanation, I get what the rename columns was there for now. Thanks!

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!
RandyHayes
Super User
Super User

@TheRobRush 

Yes...and...alright - you got me.  I'm always looking for shortcuts.  I get bored typing the same thing over and over, which is why ["...", "..."] is nice.  But, that always produces just the Value column.   But writing one RenameColumns is not too boring for me.  🤣😂

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
TheRobRush
Super User
Super User

Haha I totally understand that, I tend to iron out what I want in first item of my table, then copy paste it however many times i need it and just change the data inside. Though if I am being honest I almost never use this method and instead base anything like that on a splist and set up dependencies there instead so that I only need edit a single item in a single location as opposed to going through and changing however many lines of code it will be if I manually did it every time. So also guilty of shortcutting it

_____________________________________________________________________________________
Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.
This helps others find solutions to future issues!
RandyHayes
Super User
Super User

@TheRobRush 

I think that any method that gets to the finish line fastest is a good way to go.  I'm guilty of the copy/paste for repetition on tables as well.  Actually, I usually flush out all the repetition and formatting in a separate text editor as the Formula Editor is not all that friendly when doing massive changes repetitively.  That's because any little lag in your typing and the formula will start to evaluate...and you have that annoying pause to wait for.

 

Anyway...there are so many fun ways in PowerApps!! 😀

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements

Celebrating the May Super User of the Month: Laurens Martens

  @LaurensM  is an exceptional contributor to the Power Platform Community. Super Users like Laurens inspire others through their example, encouragement, and active participation. We are excited to celebrated Laurens as our Super User of the Month for May 2024.   Consistent Engagement:  He consistently engages with the community by answering forum questions, sharing insights, and providing solutions. Laurens dedication helps other users find answers and overcome challenges.   Community Expertise: As a Super User, Laurens plays a crucial role in maintaining a knowledge sharing environment. Always ensuring a positive experience for everyone.   Leadership: He shares valuable insights on community growth, engagement, and future trends. Their contributions help shape the Power Platform Community.   Congratulations, Laurens Martens, for your outstanding work! Keep inspiring others and making a difference in the community!   Keep up the fantastic work!        

Check out the Copilot Studio Cookbook today!

We are excited to announce our new Copilot Cookbook Gallery in the Copilot Studio Community. We can't wait for you to share your expertise and your experience!    Join us for an amazing opportunity where you'll be one of the first to contribute to the Copilot Cookbook—your ultimate guide to mastering Microsoft Copilot. Whether you're seeking inspiration or grappling with a challenge while crafting apps, you probably already know that Copilot Cookbook is your reliable assistant, offering a wealth of tips and tricks at your fingertips--and we want you to add your expertise. What can you "cook" up?   Click this link to get started: https://aka.ms/CS_Copilot_Cookbook_Gallery   Don't miss out on this exclusive opportunity to be one of the first in the Community to share your app creation journey with Copilot. We'll be announcing a Cookbook Challenge very soon and want to make sure you one of the first "cooks" in the kitchen.   Don't miss your moment--start submitting in the Copilot Cookbook Gallery today!     Thank you,  Engagement Team

Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!      

Tuesday Tip | How to Report Spam in Our Community

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   Today's Tip: How to Report Spam in Our Community We strive to maintain a professional and helpful community, and part of that effort involves keeping our platform free of spam. If you encounter a post that you believe is spam, please follow these steps to report it: Locate the Post: Find the post in question within the community.Kebab Menu: Click on the "Kebab" menu | 3 Dots, on the top right of the post.Report Inappropriate Content: Select "Report Inappropriate Content" from the menu.Submit Report: Fill out any necessary details on the form and submit your report.   Our community team will review the report and take appropriate action to ensure our community remains a valuable resource for everyone.   Thank you for helping us keep the community clean and useful!

Community Roundup: A Look Back at Our Last 10 Tuesday Tips

As we continue to grow and learn together, it's important to reflect on the valuable insights we've shared. For today's #TuesdayTip, we're excited to take a moment to look back at the last 10 tips we've shared in case you missed any or want to revisit them. Thanks for your incredible support for this series--we're so glad it was able to help so many of you navigate your community experience!   Getting Started in the Community An overview of everything you need to know about navigating the community on one page!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Ranks and YOU Have you ever wondered how your fellow community members ascend the ranks within our community? We explain everything about ranks and how to achieve points so you can climb up in the rankings! Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Powering Up Your Community Profile Your Community User Profile is how the Community knows you--so it's essential that it works the way you need it to! From changing your username to updating contact information, this Knowledge Base Article is your best resource for powering up your profile. Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Community Blogs--A Great Place to Start There's so much you'll discover in the Community Blogs, and we hope you'll check them out today!  Community Links: ○ Power Apps ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Unlocking Community Achievements and Earning Badges Across the Communities, you'll see badges on users profile that recognize and reward their engagement and contributions. Check out some details on Community badges--and find out more in the detailed link at the end of the article! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio    Blogging in the Community Interested in blogging? Everything you need to know on writing blogs in our four communities! Get started blogging across the Power Platform communities today! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Subscriptions & Notifications We don't want you to miss a thing in the community! Read all about how to subscribe to sections of our forums and how to setup your notifications! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Getting Started with Private Messages & Macros Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member! Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Community User Groups Learn everything about being part of, starting, or leading a User Group in the Power Platform Community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Update Your Community Profile Today! Keep your community profile up to date which is essential for staying connected and engaged with the community. Community Links: ○ Power Apps  ○ Power Automate  ○ Power Pages  ○ Copilot Studio   Thank you for being an integral part of our journey.   Here's to many more Tuesday Tips as we pave the way for a brighter, more connected future! As always, watch the News & Announcements for the next set of tips, coming soon!

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

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