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 / Cascading (dependent) ...
Power Apps
Answered

Cascading (dependent) Dropdowns

(0) ShareShare
ReportReport
Posted on by 32

Hello,


I would like to filter my second dropdown by the first one. Beside this, both should filter my gallery. 


I have collections on my screen
OnVisible:

ClearCollect(Collect_customer, {Value: "Show All"});
ClearCollect(Collect_Factor_name, {Value: "All"});
Collect(Collect_customer, Distinct(Factors, Customer));
Collect(Collect_Factor_name, Distinct(Factors, Factor));


First dropdown which is sorting by "Customer":
Items:

Sort(Collect_customer,Value,SortOrder.Ascending)


Second dropdown which is sorting by "Factor":
Items:

If(
 Customer_dropdown.Selected.Value = "Show All", Collect_Factor_name,
 Customer_dropdown.Selected.Value <> "Show All", Filter(Collect_Factor_name, LookUp(Factors, Factorid = ThisRecord.Factorid, Customer) = Customer_dropdown.Selected.Value)
)


It is working pretty well on "Show All" , I have a full list of possible factors:

Venqui_0-1681213806860.png


But when I choose first specific "Customer" I got same result as "Show All" even with factors booked for another customer.
When I select another specific customer, Factor dropdown is empty. Look at below screen.

Venqui_1-1681214005521.png

 

I assume that my second condition in IF function is not working correctly, but I didn't get any warnings. So, it is hard for me to understand what is wrong with this.

Thank you in advance for your help!



Categories:
I have the same question (0)
  • Venqui Profile Picture
    32 on at

    OK, I made some adjustments. 

    It is working with:

    If(
     Customer_dropdown.Selected.Value = "Show All", Collect_Factor_name,
     Customer_dropdown.Selected.Value <> "Show All",Distinct(Filter(Factors, Customer = Customer_dropdown.Selected.Value), Factor)
    )

      
    So, my other question is how to add "All" to those factors to be able show all factors assigned to particular customer?

  • Verified answer
    Venqui Profile Picture
    32 on at

     

    I found a solution. I used Ungroup() and Table() function to add "All" option to my dropdown (without creating a collection). So the "All" option was added to Filtered options based on first dropdown. 

    Factor Dropdown Items:

    Sort(
     If(
     Customer_dropdown.Selected.Value = "Show All", Sort(Collect_Factor_name,Value, SortOrder.Ascending),
     Customer_dropdown.Selected.Value <> "Show All", Ungroup(
     Table(
     {DropdownOptions: ["All"]},
     {DropdownOptions: Distinct(Filter('backoffice.Factors', Customer = Customer_dropdown.Selected.Value), Factor)}
     ),
     "DropdownOptions"
     )
    ), Value, SortOrder.Ascending
    )

     

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard