Skip to main content
Community site session details

Community site session details

Session Id : j7sQYOMyX2r8DeOR026RcR
Power Apps - Building Power Apps
Answered

Dynamic Dropdown not working

Like (0) ShareShare
ReportReport
Posted on 8 Apr 2024 07:23:29 by 8

I have a PowerApp in which I have a form the form contains 3 dropdowns 1. Site 2. Team and 3. Assigned Person. Now based on the selected dropdown 1 and 2 (Site and Team) I have to filter assigned Person dropdown and if any one or both are missing then the default values i.e a collection( ColAllValues) should be displayed in the Assigned Person dropdown. How can I achieve this?

I added in the items property of Assigned Person Dropdown this code but it is not working:

 

If(

IsBlank(First(drpSite.SelectedItems)) && IsBlank(First(drpTeam.SelectedItems)),

SortByColumns(

Filter(

ColAllValues,

Urgent= If(

drpTrigger.Selected.Value = "Urgent",

true,

false

)

),

"Title",

SortOrder.Ascending

),

IsBlank(First(drpSite.SelectedItems)),

SortByColumns(

Filter(

ColAllValues,

Team in drpTeam.SelectedItems.Value,

Urgent= If(

drpTrigger.Selected.Value = "Urgent",

true,

false

)

),

"Title",

SortOrder.Ascending

),

IsBlank(First(drpTeam.SelectedItems)),

SortByColumns(

Filter(

ColAllValues,

Site in drpSite.SelectedItems.Value,

Urgent= If(

drpTrigger.Selected.Value = "Urgent",

true,

false

)

),

"Title",

SortOrder.Ascending

)

);

 


I also added this code on the Onchange of the dropdown 1 and 2 i.e. site and team and added it to a collection and on the items property of Assigned Person I added but this is also not working

 

If(Isblank(colFilteredAssignedPerson),colAllValues,colFilteredAssignedPerson)

 

Please help me how can I achieve it.

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    148,833 Most Valuable Professional on 08 Apr 2024 at 08:03:39
    Re: Dynamic Dropdown not working

    HI @kund14 ,

    You should be able to condense it to this to

    With(
     {_Urgent: drpTrigger.Selected.Value = "Urgent"},
     SortByColumns(
     Filter( 
     ColAllValues,
     (
     Len(drpTeam.Selected.Value) = 0 ||
     Team in drpTeam.SelectedItems
     ) &&
     (
     Len(drpSite.Selected.Value) = 0 ||
     Site in drpSite.SelectedItems
     ) &&
     (
     Len(drpTrigger.Selected.Value) = 0 ||
     Urgent = _Urgent
     ) 
     ),
     "Title",
     SortOrder.Ascending
     )
    )

    I assume you also want to allow for nothing being selected in the Urgent drop-down (so show all records)

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • v-jefferni Profile Picture
    on 08 Apr 2024 at 08:02:14
    Re: Dynamic Dropdown not working

    Hi @mmbr1606 @mmbr1606 ,

     

    The first condition is unnecessary:

     

    SortByColumns(
     Filter(
     ColAllValues,
     Urgent= If(drpTrigger.Selected.Value = "Urgent",true,false) &&
     (IsEmpty(drpSite.SelectedItems)||Team in drpTeam.SelectedItems.Value) && 
     (IsEmpty(drpTeam.SelectedItems)||Site in drpSite.SelectedItems.Value)
     ),
     "Title",
     SortOrder.Ascending
    )

     

    Best regards,

     

     

  • mmbr1606 Profile Picture
    13,266 Super User 2025 Season 2 on 08 Apr 2024 at 07:25:31
    Re: Dynamic Dropdown not working

    hey @kund14 

     

    can u try this:

    If(
     IsBlank(drpSite.Selected.Value) && IsBlank(drpTeam.Selected.Value),
     ColAllValues, // Show all values if both Site and Team are not selected
     Filter(
     ColAllValues,
     (IsBlank(drpSite.Selected.Value) || Site = drpSite.Selected.Value) &&
     (IsBlank(drpTeam.Selected.Value) || Team = drpTeam.Selected.Value) &&
     Urgent = If(drpTrigger.Selected.Value = "Urgent", true, false)
     )
    )
    

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2