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 / Reset cascading Combo ...
Power Apps
Answered

Reset cascading Combo box that also have DefaultSelectedItems formula

(0) ShareShare
ReportReport
Posted on by 17

I have 2 cascading combo boxes (Region and Country). Selecting a Region will filter the Country combo box with the countries in that region. What I want to achieve is that every time a user changes the Region, the Country combo box is cleared and forces the user to select the country again. 

 

OnChange for the Region has the below code to trigger a reset for Country:

UpdateContext({ResetDropdown: true});
UpdateContext({ResetDropdown: false})

 

Rest of the Country has the below code:

ResetDropdown

The Country also has a formula for DefaultSelectedItem as below:

If(variableStatus <>"New",LookUp(Country,ID=variableSelectedItem.Country.Id))

 

If variableStatus = "New" then this works without an issues.

 

The problem comes in the case the variableStatus is <> "New". I cannot find a way to to reset the Country as the below would understandably not work:

 

If(variableStatus <>"New" && ResetDropDown , LookUp(Country,ID=variableSelectedItem.Country.Id))

 

I had tried to have the ResetDropDown set to true onChange of the Region and then make it false again OnChange of Country but could not get anywhere. 

 

Would appreciate any guidance.

Cheers

 

Categories:
  • WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    Hi @PowerAppsx23 ,

    I have not tested this, but if you removed UpdateContext({ResetDropdown: false}) from Region and put it on the OnChange of Country, would that work?

     

    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.

  • PowerAppsx23 Profile Picture
    17 on at

    Hi @WarrenBelz , 

    Thanks for your reply. 

     

    Moving the false to OnChange of the country does not fix it. From what I understand the Reset for the Country causes the OnChange to fire even before the user would get a chance to select something from the Country combo box. 

  • WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    Hi @PowerAppsx23 ,

    Back to basics a bit - the Form Mode can be added later, but I have tested below the way I normally reset the second combo, with a simple reset from the first one.

    ComboReset.gif

    So in your case, you just need to have 

    Reset(YourCountryDropDownName)

    However your DefaultSelectedItems of

    If(
     variableStatus <>"New",
     LookUp(
     Country,
     ID=variableSelectedItem.Country.Id
     )
    )

    is the issue - this is what the control will reset to when instructed to. You would normally just have 

    ThisItem.Country

    to display the current record value.

    What do you actually want to happen on an existing record? The Items will definitely reset as per my example above.

  • PowerAppsx23 Profile Picture
    17 on at

    Hi @WarrenBelz , 

    This form server the purpose of both, create a record as well as update a record depending how it got to the current screen. If it is a create record mode then everything works as it should but its the update mode that causes an issue. 

     

    Regards,

     

  • WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    @PowerAppsx23 ,

    Did you look at what I posted? I am not sure how to respond further.

  • Verified answer
    PowerAppsx23 Profile Picture
    17 on at

    Hi @WarrenBelz, 

    Thanks for your help. I manages to solve the issue. When the from loads, I have set an initial Boolean variable based on the SelectedItem value of Region and when the region changes I update the variable and use that in the DefaultSelectedItems for Country as below:

     

    OnVisible of the screen I set a variable: 

    UpdateContext({varLoadDefaultCountry:true});

     

    OnChange of the Region I do the below:

    UpdateContext({ResetDropdown: true});
    UpdateContext({ResetDropdown: false});
    If (SelectedItem.Region.Id = cboRegion.Selected.Id,UpdateContext({varLoadDefaultCountry:true}),UpdateContext({varLoadDefaultCountry:false}))

     

    Reset of the Country has below:

    ResetDropdown

     

    and finally DefaultSelectedItems of the Country has this:

    If(varIdeaStatus <>"New" && varLoadDefaultCountry,LookUp(Country,ID=SelectedIdea.Country.Id))

     

    Cheers

  • ccpower88 Profile Picture
    3 on at

    Can you please tell, what is variableStatus here

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
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard