Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Clearing dropdown B every time Dropdown A changes

(0) ShareShare
ReportReport
Posted on by 909 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 at
    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
    909 Super User 2024 Season 1 on at
    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 at
    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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard