cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
R3dKap
Level 10

ResetForm not called when clicking outside the custom SharePoint list form

Let's say you have a custom list form and you do the following:

  • you select an item from the list where a field has a value of "ABCD"
  • you click "Modify" > the form is shown
  • you set a field to "AAAA"
  • you click on the cross in the upper-right corner of the form > the forms is closed
  • you click on "Modify" again > the form is shown
  • the field is still "AAAA" ?!?!
  • you set the field to "BBBB"
  • you click outside the form > the form is closed
  • you click on "Modify" again > the form is shown
  • the field is still "BBBB"
  • you click on "Cancel" (the button) > the form is closed
  • you click on "Modify" again
  • the field has the value "ABCD"

 

Why isn't the form reset when we click outside the form or on the upper-right cross ? Why are there different behaviors here ? Very painful...

 

 

2 REPLIES 2
Community Support Team
Community Support Team

Re: ResetForm not called when clicking outside the custom SharePoint list form

Hi @R3dKap,

 

I have made a test and the issue is confirmed on my side.

 

There are some things to keep in mind when you customize forms:



 

  • You can't control the hiding of a form when a user clicks or taps Cancel in SharePoint, so make sure you reset your forms in the OnCancelformula of the SharePointIntegration control.

 

  • The properties for the SharePointIntegration control may not be available in OnStart or OnVisible, and those events execute only once while the list is loaded. You can use OnNewOnView, or OnEdit formulas to run logic before the form is shown to the user every time.

 

In other words, the custom SP list form could only be loaded once when you added a new item or edited an existing item. When you click the outside the form or on the upper-right cross, the form would be hidden rather than closed, so your form would not be reset.

 

But when you click the "Cancel" button within the form, it would trigger the OnCancel property of the SharePointIntegration control, and then hide the form (rather than close the form). The OnCancel property of the SharePointIntegration control set to following formula:

ResetForm(SharePointForm1)

So it would reset your form when you click the "Cancel" button.

 

More details about the things to keep in mind when you customize forms, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/sharepoint-form-integration

 

In addition, if you want to reset the form when you click the outside the form or on the upper-right cross, please take a try with the following workaround as an alternative solution:

 

Set the OnEdit property of the SharePointIntegration control to following formula:

ResetForm(SharePointForm1);EditForm(SharePointForm1)

4.JPG

 

 

Best regards,

Kris 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Alisona
Level: Powered On

Re: ResetForm not called when clicking outside the custom SharePoint list form

Hello,

 

I have tested this solution, and it does not work

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,046)