Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Cascading Dropdowns

(0) ShareShare
ReportReport
Posted on by 85

I have a SP list named "Order Parts Lookup" that I'm using as the datasource for both dropdowns. Dropdown1 (Group) is working correctly using the following formula:

 

Dropdown1 = Group (getting category column from datasource)

SortByColumns(Distinct(Filter('Order Parts Lookup', Title = "CXM").Category,Category), "Result")

 

Dropdown2 = Item Master

Item Master is causing an error. I want to populate item master with values from the "PS Item ID" column in the datasource. If for example I choose 'Router' for a Group selected value then I need to bring back all "PS item ID"s into the Item master field where 'Router' is the category for that lookup record. Below is the formula I'm trying to use and the corresponding error:

 

Filter('Order Parts Lookup', Category=Group.Selected.Value) <<< formula

Name isn't valid. 'Value' isn't recognized. <<< Error

 

or better yet, if I use: 

'Order Parts Lookup.'PS Item ID' I get all the values back no problem. How would I filter that to bring back only records with Category = Group selected value.

 

 

  • RandyHayes Profile Picture
    RandyHayes 76,287 on at
    Re: Cascading Dropdowns

    @AhmedSalih 

    Well...unfortunately, even that is not a guarantee.  I've been burned before by abilities that were designed into the platform that worked and were solid, and then were removed with NO warning or depreciation notice!  So, given that, if I see deprecated, I am doubly alert!

  • AhmedSalih Profile Picture
    AhmedSalih 6,678 on at
    Re: Cascading Dropdowns

    @RandyHayes, I ma so glad you mentioned that because from now on before using controls' properties, I will make sure they are here to stay, at least in the time I am using them. 

  • RandyHayes Profile Picture
    RandyHayes 76,287 on at
    Re: Cascading Dropdowns

    @AhmedSalih 

    It is misleading!!  It is not clear why they would say the primary property (SelectedText) is deprecated and yet a column of that record would not be.  So, my assumption on that is that the primary property is deprecated.  

    In general it should be avoided anyway because of they are typing to type-cast various types into a single value type - which is always subject to error (and my personal thought as to why it would be deprecated).  To be less subject to error, the Selected property with the correct column should be specified. 

     

    In this particular case, the Items property of the dropdown ONLY had a Result column (from the Distinct function).  So, technically the SelectedText would be just that...the only possible selected text.

    BUT, what if the case was different.  What if the dropdown had and Items property with user information in it.  AND, someone says "it should show the email of the person".  And then you write your formulas with the SelectedText (assuming it is going to be the Email shown, which it would) and that your formula is based on perhaps filtering by the email (ie.  Filter(someList, emailColumn = dropdown.SelectedText.Value) )

    NOW, someone says, "I don't like the email listed, can we display the Full Name instead?", and so you change the value displayed in the dropdown to "DisplayName".  Well...now the filter function will not return the correct results as SelectedText.Value is now something different.

    However, Filter(someList, emailColumn = dropdown.Selected.Email) will work regardless of what the displayed column value is!

     

     

  • AhmedSalih Profile Picture
    AhmedSalih 6,678 on at
    Re: Cascading Dropdowns

    @RandyHayes, Just for confirmation, in this documentation  it say we can "use Dropdown1.SelectedText.Value instead" So, would that work always or they will remove the whole thing all together? 

  • WarrenBelz Profile Picture
    WarrenBelz 145,580 on at
    Re: Cascading Dropdowns

    Hi @ShawnPelletier ,

    Assuming Group is the name of your Combo Box

    Filter(
     'Order Parts Lookup', 
     Category = Group.Selected.Result
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • RandyHayes Profile Picture
    RandyHayes 76,287 on at
    Re: Cascading Dropdowns

    @ShawnPelletier 

    Just keep in mind that SelectedText is a deprecated property!!  It might one day simply no longer work once they remove the property completely. 

    I would advise using the proper column name based on the records in your Items property of the control.

     

    Since you are using Distinct in your Items property, that means the only column available would be Result...and thus your formula should be:

        Filter('Order Parts Lookup', Category=Group.Selected.Result)

     

    I hope this is helpful for you.

  • ShawnPelletier Profile Picture
    ShawnPelletier 85 on at
    Re: Cascading Dropdowns

    Thank you! Worked beautifully!

  • Verified answer
    zuurg Profile Picture
    zuurg 524 on at
    Re: Cascading Dropdowns

    Have you tried SelectedText instead of Selected?

    Filter('Order Parts Lookup', Category=Group.SelectedText.Value)

     

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard