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 / Clearing dropdown B ev...
Power Apps
Answered

Clearing dropdown B every time Dropdown A changes

(0) ShareShare
ReportReport
Posted on by 920 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?

Categories:
I have the same question (0)
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    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!

  • wonka1234 Profile Picture
    920 Super User 2024 Season 1 on at

    @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)

  • LaurensM Profile Picture
    12,516 Moderator on at

    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?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 600

#2
WarrenBelz Profile Picture

WarrenBelz 478 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 322

Last 30 days Overall leaderboard