Skip to main content

Notifications

SharePoint: Cascading Dropdowns in 4 Easy Steps!

Preparation (data sources):

 

I've decided to use two SharePoint Lists for this example. One as the app data source, and the other for the dropdown list values. Using a SharePoint list for my dropdown values enables end users to modify the form logic on their own. You could use any data source you prefer.

 

The control values list (named: Impacts)

Keeping it simple, I created a list called Impacts with two columns as shown below. Title (main request type), and SCategory (aka sub category - I didn't want to use any spaces or symbols there). The list is sorted by Title, Ascending. (I keep these in a separate list so that I can always show the same set of values in my dropdowns, even if there is nothing in the datasource for my app related to these selections.)

 

Impacts.PNG

 

 

 

The PowerApp List/Data Source (named: CR):

The SharePoint List that will collect the submissions from the PowerApp is very simple so as to facilitate this demo. It has three columns:

  • Change Impact (which is really just the Title column renamed)
  • Sub-Category (single line of text) - optional note: You could make this a choice list if users might be updating directly in SharePoint classic mode as well, only it can not be a multi-select choice list.
  • Answer (multi-line plain text field)

    You'll notice I entered 1 item/record manually using the regular SharePoint "New Item" command, that's just to make it easier to customize my forms. (It can be difficult to customize the forms until you have at least 1 record in the list. You can always delete that configiration record later.)

CR.PNG

 

Adding and Configurating the Dropdown Controls in 4 Easy Steps

 

OK. Now we're ready to have fun.....

 

Step 1: Generate a New Power App from the SharePoint CR List. PowerApps does most of the work for you, leaving you with a fully functional app with Browse Gallery, Display Form, and Edit/New Item Forms.

 

ribbon.png

 

dialog.png

 

Step 2: Add another connection to the app (Content Tab>Data Sources>(far right of screen) + Add data source) that references the "Impacts" list from the site as well. You should now have two data sources in your app, the one PowerApps added for you (destination data source), and the one you just added to the other list.

 

Tip: You can reuse data sources for controls by dedicating a CDS entity, or other data source like SharePoint for that purpose. For instance, I have a SharePoint site collection that is open to "Everyone except external users", where I keep a bunch of controls stuff - but CDS is perfect for this too! Just remember to permission the shared data source so that all users have the rights to read (but not write), and when using SharePoint also disable search results on each list so that the items don't come up in enterprise search results. Aren't you lovin' the fact that you can add additional data sources to your SharePoint PowerApp views so easily!?

 

AddImpacts.PNG

 

Step 3: Make some room above the gallery on the first screen and add a Dropdown Control (Insert>Controls>Dropdown), I named mine "ddSelectType". Set the "Items" property to Distinct(Impacts,Title) to get all the main topics from our Impacts list into that dropdown. Run to test (F5).

 

screen1.PNG

 

newdropdown.PNG

 

Step 4: We're almost done already! Let's make some more room and add another dropdown, which I named ddSubCategory. We will simply filter the ddSubCategory dropdown based on the selection from the first dropdown.

 

The Items property of ddSubCategory:

Filter(Impacts,ddSelectType.Selected.Value in SCategory)

 

Run and test! I just works!

 

 

CostWorking.PNG

 

I plan to share many tips on making your apps interesting, and incorporating data validation. Let me know if you'd like any particular topic and I'll do my best to make that happen for you! Keep visiting the Community because I'll be posting video demos with your popular questions asked as well.

 

Enjoy your PowerApps experience!

 

Audrie

Comments

*This post is locked for comments

  • JoanaVB Profile Picture JoanaVB 27
    Posted at
    SharePoint: Cascading Dropdowns in 4 Easy Steps!

    Thank you Audrie, I managed to put it to work with the new method and the hints you gavee in this article, but unfortunatly I need this to work in a Document Library and although the dropdown works I am not uble to update the document item with th new edited dropdown values. It simply dosen't save the item. Can you help?

  • Audrie101 Profile Picture Audrie101
    Posted at
    SharePoint: Cascading Dropdowns in 4 Easy Steps!

    @JoanaVB The method I posted long ago is no longer necessary (although it should still work). Instead, I suggest trying out the new features for dependent dropdowns. This may get you exactly what you need:

     

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/dependent-drop-down-lists

     

    Thank you for your questions and feedback,

    Audrie

  • JoanaVB Profile Picture JoanaVB 27
    Posted at
    SharePoint: Cascading Dropdowns in 4 Easy Steps!

    Hello @audrieg,

     

    Thank you so much fot this very clear expanation. I was able to reproduce your steps and its working fine, but this newly created dropdowns are not associated with the fields on  list CR or did I miss something? I need to be able to add new records to the CR list where the first 2 fields "Change Impact" and "Sub-Category" will be filled with the selections I make in the 2 Drop Downs. Is that possible? If so, how to do it?

    If the answer is  the DataCard:  Update function is set to'mydropdown'.Selected.Value. I cant find it

    Thanks in advance, Joana

  • SharePoint: Cascading Dropdowns in 4 Easy Steps!

    Ensure that the DataCard:  Update function is set to'mydropdown'.Selected.Value

  • SharePoint: Cascading Dropdowns in 4 Easy Steps!

    @audrieg

    i have cascaded a drop down for multiple column on same sharepoint list and its working fine.
    but after saving the data ...the cascading frop down is reseting to default value .and i am not able to see the saved data from cascading drop down......!

     

    Can you please help me with this....

  • ishantk Profile Picture ishantk
    Posted at
    SharePoint: Cascading Dropdowns in 4 Easy Steps!

    One feasible option is you can add control from Insert tab. Add dropdown list and add list as a datasource which you need take as cascading.

    Need to set filter in dropdown lists. so basically same datasource will be used for all drop down lists,  but filter will make it work as cascading.

  • Hulu Profile Picture Hulu
    Posted at
    SharePoint: Cascading Dropdowns in 4 Easy Steps!

    Hi @audrieg

     

    I had a warning when creating the second dropdown, it says "Delegation warning. The highlighted part of this formula might not work correctly with column "fjsw" on large data sets. The data source might not be able to process the formula and might return coreect results or behave correctly if the data set is incomplete." And the part "ddSelectType" is highlighted and there is wave line under "in". Could you please take a look? Thank you!

    2.png

     

     

     

  • SharePoint: Cascading Dropdowns in 4 Easy Steps!

    Thanks very much @audrieg! Yes this workek - you are a life saver! Thanks again.

     

    May I also ask one more thing please. The cascading drop down works but I'd like the drop down to display as blank first when the user creates a new list item. At the moment, the drop down field displays the first item in the list straight away. I thought a workaround would be to add a "no value" item at the start of the list but this means I then need to add "no value" item in the other cascading drop downs and theres a lot! Is there a formula that I can add so that the drop down controls display a blank field first?

     

    Thanks again

  • Audrie101 Profile Picture Audrie101
    Posted at
    SharePoint: Cascading Dropdowns in 4 Easy Steps!

    @Anonymous try adding .Title right after the first close parenthesis. Let me know if that works. I think you just need to say what column will be the result of the filter.

  • SharePoint: Cascading Dropdowns in 4 Easy Steps!

     Hi @audrieg,

     

    I have used a slightly different way because I get a blue dot that says something along the lines of "limited service" . Instead, I used the below in the Item formula, which seems to work but the problem is the drop down items are not visible! 

     

    I think its looking up the information but it just isn't visible. Would you know by any chance and how to fix this?

     

    Thanks in advance.

     

    I have tried Cascading dropdownPNG.PNG