cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Patron
Post Patron

Save Record and Stay on the Same Record

I've read lots of discussions on this but still don't feel I've found a clear answer.  

I would like to save my form and have it remain on that same form instead of going away.  Right now, the form has this in OnSuccess: ResetForm(OrderForm);RequestHide().  If I remove the RequestHide, it functions as I'd like -- EXCEPT -- when creating a NEW record.  

When I create a new record, it displays the very first record and not the one I just saved.  

 

Any thoughts on how to get it back to the just-saved record if a new record? 

 

Thanks in advance for your help and consideration.    

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Save Record and Stay on the Same Record

Hi @CindyZ ,

Do you want to remain the submitted form data within the Edit form when you create a new record?

Could you please show more details about the formula you typed within the Item property of the Edit form?

 

I have made a test on my side, please consider take a try with the following workaround:

Set the OnSuccess property of the SharePointForm1 to following:

Set(SubmittedRecord, OrderForm.LastSubmit);
ResetForm(OrderForm)

 

Set the Item property of the SharePointForm1 to following:

If(
   OrderForm.Mode = FormMode.Edit,
   If(
      !IsBlank(SubmittedRecord),
       SubmittedRecord,
       SharePointIntegration.Selected
   )
)

 

Set the DefaultMode property of the OrderForm to following:

FormMode.Edit

 

Set the OnNew property of SharePointIntegration to following:

Set(SubmittedRecord, Blank());
NewForm(OrderForm)

 

Please consider take a try with above solution, 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

6 REPLIES 6
Highlighted
Super User
Super User

Re: Save Record and Stay on the Same Record

Forms have a property: LastSubmitted. You can use that to see the details of the record you just saved.

You should then be able to use those details to set the Item property of the form and put the form into Edit mode, so after saving, you see the record you just saved in Edit mode in the form.

You may need to use to variables to store the LastSubmitted details and whether the the last submission was New or Edit.

Highlighted
Community Support
Community Support

Re: Save Record and Stay on the Same Record

Hi @CindyZ ,

Do you want to remain the submitted form data within the Edit form when you create a new record?

Could you please show more details about the formula you typed within the Item property of the Edit form?

 

I have made a test on my side, please consider take a try with the following workaround:

Set the OnSuccess property of the SharePointForm1 to following:

Set(SubmittedRecord, OrderForm.LastSubmit);
ResetForm(OrderForm)

 

Set the Item property of the SharePointForm1 to following:

If(
   OrderForm.Mode = FormMode.Edit,
   If(
      !IsBlank(SubmittedRecord),
       SubmittedRecord,
       SharePointIntegration.Selected
   )
)

 

Set the DefaultMode property of the OrderForm to following:

FormMode.Edit

 

Set the OnNew property of SharePointIntegration to following:

Set(SubmittedRecord, Blank());
NewForm(OrderForm)

 

Please consider take a try with above solution, 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

Highlighted
Helper I
Helper I

Re: Save Record and Stay on the Same Record

One issue with this process, although it works, the form cannot be opened and edited.  SharePoint opens the form and it just says "Getting your data" and never shows any fields.  Any idea how to solve this?  The rest of your process works well.

Highlighted
Helper I
Helper I

Re: Save Record and Stay on the Same Record

Eventually says this "An entry is required or has an invalid value. Please correct and try again."
Highlighted
Helper I
Helper I

Re: Save Record and Stay on the Same Record

This is the issue: If( SharePointForm1.Mode = FormMode.Edit, If( !IsBlank(SubmittedRecord), SubmittedRecord, SharePointIntegration.Selected ) )

 

When I go back and open the item it just says getting data and never opens.

 

 

While the default works, on save it bounces back to the previous record entered: If(IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),First([@'Test List']),SharePointIntegration.Selected)

 

I'd like it to stay on the existing record I just saved.  Any way to modify the first statement to accomplish this?

Highlighted
Helper I
Helper I

Re: Save Record and Stay on the Same Record

I solved on my own by doing the following: If(IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),Last([@'Test List']),SharePointIntegration.Selected) That is the default statement in the form generates, however I change First to Last in the statement.  I opened several tabs with the same list and had saved multiple records, and each one remained on the existing record.

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,987)