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 / ResetForm not working ...
Power Apps
Answered

ResetForm not working as expected

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a new item button on my BrowseScreen

OnSelect = NewForm(EditForm1);Navigate(EditScreen1, ScreenTransition.None);Set(varFormMode, "New")

and a cancel button on my EditScreen1, OnSelect = ResetForm(EditForm1);Back()

When EditForm1 is invoked as NewForm() from the BrowseGallery, but then cancelled, the EditForm1 shows for a second or two the values from the currently selected item in the Gallery before it goes back to the BrowseGallery from where it was called. This is not desired, if not annoying - especially in Edge and Firefox, in Chrome the transition is much faster and it's hardly noticed.

 

What can I do to avoid that?

 

Categories:
I have the same question (0)
  • PeteMc Profile Picture
    168 on at

    There is a couple of this to try.

     

    1. Try calling Back() before the reset form command

    2. Set Item on the form to be conditional: IF(varFormMode = "New", Defaults([DataSource]), Lookup([Datasource],[condition]))

  • Verified answer
    corey_msft Profile Picture
    Microsoft Employee on at

    @PeteMc has a good suggestion with #2.  Please try the following: 

     

    On your browse screen, set:

        BrowseScreen1.OnVisible = Set(varFormMode, "")

        NewItemButton1.OnSelect = NewForm(EditForm1);Set(varFormMode, "New");Navigate(EditScreen1, ScreenTransition.None);

     

     

    Then, on your edit screen, set:

        EditForm1.Item = If(varFormMode = "New", Defaults('YourTableNameHere'), BrowseGallery1.Selected)

        CancelButton1.OnSelect = ResetForm(EditForm1);Back()

     

    The goal here is to delay EditForm1.Item from being reset back to BrowseGallery1.Selected.  When navigating to EditForm1 in "New" mode, varFormMode is set to "New"; this allows EditForm1 to use a default "empty" record as its Item. When clicking the cancel button, EditForm1 is reset but should still show the default "empty" record until varFormMode is set to "" (or anything except "New") when BrowseScreen1 becomes visible.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks @PeteMc #1 didn't make any change, #2 did the trick with the tweaks provided by @_Corey_. Defaults() was definitely key, but as well clearing varFormMode.

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
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard