web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Reset dropdpown does n...
Power Apps
Unanswered

Reset dropdpown does not work in edit form

(0) ShareShare
ReportReport
Posted on by 104

Hi

 

I'm trying to reset a dropdown based on selection of another dropdown. I noticed this works only in Newform but not in Editform if the 2nd dropdown already has some data saved before. This is how I'm resetting the 2nd dropdown. In the onchange event of the first dropdown, I set a variable value

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

 

I set the Reset function in the 2nd dropdown to the variable ResetD2.

 

Any workaround?

 

Thanks

Categories:
I have the same question (0)
  • dinusc Profile Picture
    Microsoft Employee on at

    Hello @Rajesh,

    I would suggest to use the Reset function instead of setting the Rest properties to true and false: Reset(MySecondDropDown)

    Please also note that Resetting a control disregards the currently selected value and then selects the default value. Since the DropDown default value is bound to the edited field in Edit form, that value will be automaticalyl shown after the reset. In another words, control reset in Edit form is for canceling all the edit changes and reverting to the previous value in the form. I would suggest revising the intended behavior.

  • Rajesh Profile Picture
    104 on at

    Hi

     

    Thanks for the reply. I've tried using the Reset function and the behaviour is same as that of Reset properties. It works for NewForm as there's no previously saved data, but for edit form it defaults to the previously saved value for the control as you mentioned. Is there no way to clear the value as some of the subsequent actions on the form are based on answers selected to the previous questions i.e. Answers to Q1 drives choices in Q2 which in turn drives other questions

  • dinusc Profile Picture
    Microsoft Employee on at

    If you're using DropDown control (not CmoboBox control) in Edit form and don't want it to be bound to the form source then you need to ensure it's "Default" property is empty. In that case, Reset will clear the content. If you're using a ComboBox control (default control used in forms) then make sure it's "DefaultSelectedItems" property is not bound to a form field (is empty). You may need to unlock the parent card to do that.

  • Rajesh Profile Picture
    104 on at

    Setting DefaultSelectedItems to blank is not an option as that would lead to not showing the earlier saved value by the user when an user edits the item. My requirement is when the user edits the item, show the earlier saved values for dropdown 1 and 2. If the user changes value in dropdown 1, then reset the dropdown 2 and blank the selection. Currently reset function works only in new form but not edit form and it defaults to the earlier saved value

     

     

  • dinusc Profile Picture
    Microsoft Employee on at

    As mentioned before, the Reset function is not supposed to erase the content of the ComboBox. In order to achieve the intended behaviour, you could bind the DefaultSelectedItems conditionally to the field values (in order to maintain the Edit functionality) and then to erase it after the user interacts with the ComboBox. Something like:

    Screen1.OnVisible=Set(ff, FieldValue)

    ComboBox2.DefaultSelectedItems=ff

    ComboBox1.OnChange=Set(ff,[]);Reset(ComboBox2)

     

    Hope that helps.

  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @Rajesh,

    Do you want to reset the Combo Box when the Edit form is on Edit mode as that in NewForm?

    Based on the formula you provided, I have made a test, the issue is confirmed on my side.

    The Reset() function or Reset proeprty is used to reset the Control (e.g. Combo Box control) to the default value.

    When you edit a record within the Edit form (The Edit form is in Edit mode), the Combo Box control would have a default selected value, so when you reset the Combo Box control (On your side, it is the second Drop down), it would reset your Combo Box to the original status with the default value selected.

    As an alternative solution, you could consider clear the default selected value within your Combo Box. I have made a test on my side, please take a try with the following workaround:8.JPG

    Set the OnVisible property of the first screen of your app to following:

    Set(ResetSecondCombo, Blank())

    Set the OnChange property of the first Combo Box control to following:

    Set(ResetSecondCombo, Blank());
    Set(ResetSecondCombo, true)

    Set the DefaultSelectedItems property of the second Combo Box control to following:

    If(
    !IsBlank(ResetSecondCombo),
    {},
    Parent.Default
    )

    Best regards,

    Kris

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard