Power Apps Save and New Form Button

When filling out forms, sometimes a form needs to be filled out over and over, if the end users have a lot of data to input.  In this case, it’s helpful to have a button on the form, for “Save and New”.  This saves time and prevents the user from having to submit each form and then click the new button all over again.  In this post, I’ll show you first how to create a “Save and New” button in a SharePoint list form that has been customized with Power Apps, and then in a standalone Power App .

Customized SharePoint List / Microsoft List

In my example canvas app, my form control is named frmTask, and it is a task list in an app.

1.  Go to your list. 
(In my example video that is associated with this post, I used the “Work Progress Tracker” list template.)

2.  In the toolbar at the top of the list, click the Integrate button, choose Power Apps, and choose Customize forms.

3.  In your new Power App, add two buttons, from the Insert menu.
sharepoint-microsoft-list-work-progress-tracker

4.  Type the text on the two buttons: “Save” and “Save & New”

5. Select the Save button, and to to the property called OnSelect. Use this formula:
Set( varSaveAndNew, false);
SubmitForm
( SharePointForm1 )

6.  Select the Save & New button, and to to the property called OnSelect. Use this formula:
Set( varSaveAndNew, true);
SubmitForm( SharePointForm1 )

7. Select the form control SharePointForm1, and go to the property called OnSuccess. Use this formula:
ResetForm( Self );
If(
      varSaveAndNew,
      NewForm( SharePointForm1 ),
      RequestHide()
)

8.  Go to the SharePointIntegration object, and the property called OnSave

powerapps-sharepoint-integration-OnSave

Use this formula:
Set( varSaveAndNew, false);
SubmitForm
(SharePointForm1)

 

Standalone Power App (Canvas App)

When you have a standalone Power App, there are only a couple of differences in what needs to be done to accomplish this.

First of all, your form’s OnSuccess is not going to have RequestHide, and the OnSuccess could have a different function in it depending on how you’ve built your app.  A common thing that is used in OnSuccess, is to Navigate().  Therefore, if you need to navigate to another screen when the form has been successfully submitted, you’ll have a different formula in the OnSuccess property.  It would be:

ResetForm( Self );
If(
      varSaveAndNew,
      NewForm( YourFormName ),
      Navigate( YourOtherScreenName )
)

Also, if you have a standalone canvas app, you won’t need to worry about that SharePointIntegration object, because there isn’t one.

Here is my associated demo video from Power Hour, when I built all of this, and I show you how to do it in a customized list for and in a standalone app.

powerapp-demo-save-and-new-button-power-hour

 

3 comments

  • thanks alot of informaton keren

  • This is close to what I need to do. Is is possible to save some of the info and have it already populate a portion of the form for the new. To put that into practical terms, we are doing an inventory of all the objects in a room, it would be great to keep the room information(bldg, floor, room number, ocupant) and then only need to add in the next item. I have tried a couple of different things and keep running into issues. Thanks for any suggestions

Leave a Reply