Skip to main content
Community site session details

Community site session details

Session Id : xee0F7UCMZ+EUYfB6vK2Dg
Power Apps - Building Power Apps
Answered

Clearing dropdown B every time Dropdown A changes

Like (0) ShareShare
ReportReport
Posted on 5 Sep 2023 15:15:28 by 911 Super User 2024 Season 1

Hi,

 

wonka1234_0-1693926319826.png

 

I am trying to clear the 2nd dropdown everytime the one of the left changes.

 

Ive tried 

 

Clear(DataCardValue19.Selected.Value)

Reset(DataCardValue19)

 

Can anyone help?

  • LaurensM Profile Picture
    12,510 Super User 2025 Season 1 on 05 Sep 2023 at 16:38:04
    Re: Clearing dropdown B every time Dropdown A changes

    Hi @wonka1234,

     

    Indeed, in a form the combobox/dropdown names are DataCardValue[Number] - your Reset reference looks correct! 😊

    The If statement should be written in the DefaultSelectedItems property of DataCardValue19. 

     

    Could you give that adjustment a try and see if it fixes the issue?

  • wonka1234 Profile Picture
    911 Super User 2024 Season 1 on 05 Sep 2023 at 16:07:59
    Re: Clearing dropdown B every time Dropdown A changes

    @LaurensM 

    ah thanks. So the mode is set to Edit.

     

    Now the reset should be the dropdown name - however it is a datacard, well both are choice datacards.  Not a specific dropdown.

     

    Would this change the code your are sharing? Ive tested it and it isnt clearing the 2nd dropdown.

     

    DatacardValue15 (Dropdown a) - On change - Set(varResetDrp, true); Reset(DataCardValue19)

    DataCardValue19 (Dropdown b) - Default - If(!varResetDrp, Parent.Default)

  • Verified answer
    LaurensM Profile Picture
    12,510 Super User 2025 Season 1 on 05 Sep 2023 at 15:27:59
    Re: Clearing dropdown B every time Dropdown A changes

    Hi @wonka1234,

     

    When using this code in an EditForm with DefaultMode set to New, your Reset function should work. The dropdown1 should have the following code in the OnChange property:

    //Replace with the correct DataCardValue name
    Reset(DropdownName2)

     

    In case the Form DefaultMode is set to Edit, we will need some additional logic since the second dropdown will have an auto-filled default value. The OnChange of dropdown 1 should be:

    //Replace with the correct DataCardValue name
    Set(varResetDrp, true); Reset(DropdownName2)

     

    The DefaultSelectedItems property of dropdown 2 should be:

    If(!varResetDrp, Parent.Default)

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

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 1

Loading complete