cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DoubleEx
Level: Powered On

Submit new item - need next item to be set back to defaults

I have an App that is broken into 3 screens.  The first two Add a record to the Sharepoint List.  The last one is only available to an "administrator" and ultimatel Patches and update.

 

I can create a new entry and check the Sharepoint list and find that all fo the items associated with the third screen are defaulted to the SharePoint List default values - as expected.

 

I then edit an item, make entries in the 3rd screen and save. Then I Add a new entry - that doesn't go to the 3rd screen (like my first one) but when I check SharePoint list it has the values of the 3rd screen from the item I edited.

 

Right away I assume that I have to use ResetForm or 

 

 

I even put this behind my "New" button's  OnSelect thinking I was guaranteeing that all previous entries would be wiped clean.  Is there another way to make sure no previous values are hanging around when you want to enter a new record?

ResetForm(EditForm1);
NewForm(EditForm1);
ResetForm(EditForm2);
NewForm(EditForm2);
ResetForm(ImpactForm);
NewForm(ImpactForm);
Navigate(
EditScreen1,
ScreenTransition.None
)

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Submit new item - need next item to be set back to defaults

Hi @DoubleEx ,

Could you please share a bit more about your issue?

Do you mean that your Edit form could not be reset to blank form, instead, it pull values from previous edit item?

 

I have made a test on my side, and don't have the issue that you mentioned. Please consider add the following formula within the OnSuccess property of the Edit forms within first two Screens:

ResetForm(EditForm)

Set the DefaultMode property of the Edit form (in your first two screens) to following:

FormMode.New

In addition, there is no "ClearAll" function supported within PowerApps to clear Edit forms data, and reset them to blank forms.

If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

As an alternative solution, you could consider use Patch function to submit your new form datas to your SP list instead of SubmitForm function. The formula as below:

Patch(
         'YourSPList',
          Defaults('YourSPList'),
          EditForm.Updates
)

Please also consider re-create a new app based on your SP list data source, then check if the issue is solved.

 

Best regards,

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.

View solution in original post

3 REPLIES 3
cwebb365
Level 10

Re: Submit new item - need next item to be set back to defaults

Your 3rd screen values shouldn't update. You have to have your submit property of the form set to the 3rd screen form or something else causing that since it wouldn't just pull from it when saving.

DoubleEx
Level: Powered On

Re: Submit new item - need next item to be set back to defaults

I have one form that handles Patch for both Add and Update.  My question is - regardless of how I saved the data. How do I clear data off of all forms so that the next "NEW" item doesn't pick up data from the last record displayed, added or edited.  

 

In my mind I want to "ClearAll" function when the Top Most form is loaded to absolutely guarantee blank forms.

 

I've seen a number of posts that say ResetForm(formname) - sets all the data in the form to default values and I've added  code to the submit button 

https://powerusers.microsoft.com/t5/Creating-Apps/submit-then-clear-form/m-p/117594#M2488

 

   SubmitForm(ImpactForm);
   ResetForm(ImpactForm);

 

But my next "NEW" record picks up the values from the form that was just "RESET"

Community Support Team
Community Support Team

Re: Submit new item - need next item to be set back to defaults

Hi @DoubleEx ,

Could you please share a bit more about your issue?

Do you mean that your Edit form could not be reset to blank form, instead, it pull values from previous edit item?

 

I have made a test on my side, and don't have the issue that you mentioned. Please consider add the following formula within the OnSuccess property of the Edit forms within first two Screens:

ResetForm(EditForm)

Set the DefaultMode property of the Edit form (in your first two screens) to following:

FormMode.New

In addition, there is no "ClearAll" function supported within PowerApps to clear Edit forms data, and reset them to blank forms.

If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

As an alternative solution, you could consider use Patch function to submit your new form datas to your SP list instead of SubmitForm function. The formula as below:

Patch(
         'YourSPList',
          Defaults('YourSPList'),
          EditForm.Updates
)

Please also consider re-create a new app based on your SP list data source, then check if the issue is solved.

 

Best regards,

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.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 330 members 6,040 guests
Please welcome our newest community members: