cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AdriaanOlivier
Regular Visitor

Help stop the Save button from closing my form

Good day all,

 

I am sure this is an amateur hour question but that is what I am. I am busy with a pet project to streamline some reporting functions.

(Essentially I want to stop our people from saving technical support session info in OneNote or random Word documents that is not centralized).

 

In my pursuit I have created a list, it captures the basic data for a support session but then all the complex notes and screenshots will be captured in a word document. The possibilities of is just too endless to be able to create a single form to capture all possible scenarios so a word doc works. I have created the flow that will create the Word doc according to a template when a new list record is created. The Word doc is just a copy of a template and it saves it to a library and you can open it in Sharepoint or Teams etc while you have the Sharepoint list open in another screen.

 

Okay, deep breath... Now for my question, to create the Word doc, the out of form Save button has to be clicked. This closed the open form. I don't want it to close, I want to be able to continue working on that form without having to open it again?

 

In Powerapps I tried to change the Syntax of the OnSuccess formula in the SharePointForm1 properties to various things and combinations, (the default being ResetForm(SharePointForm1); RequestHide() ). If I remove the RequestHide() it works but the form defaults to the first item in the list.

 

I have spent a whole day searching for solutions and I can't find anything definitive. I would imagine this has been asked in the past but I can't find an answer.

 

Please help.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @AdriaanOlivier :

   Do you want to submit a custom form without closing it?

   I have tried many methods, as long as the SubmitForm() function is used, the RequestHide function will be triggered to close the form. This seems to be a built-in function and we cannot change it.

   To avoid this situation, I suggest you use Patch() instead of SubmitForm.For example:

1\Set the SharePointIntegration's OnSave Property to

If(
  IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),
  Patch(ListA,Defaults(ListA),SharePointForm1.Updates),
  Patch(ListA,SharePointIntegration.Selected,SharePointForm1.Updates)
);/*ListA is my list*/
ResetForm(SharePointForm1)

1.JPG

The Result

35.gif

We can find that:

  • The form will not be closed immediately after clicking save
  • The data in the list has actually been modified, but it will not be displayed immediately. You can hit "F5" to refresh the page to display the latest data

Best Regards,

Bof

 

 

 

 

View solution in original post

4 REPLIES 4
jbrit2020
Continued Contributor
Continued Contributor

Put NewForm(SharePointForm1) instead of ResetForm on the OnSuccess property

jbrit2020, thanks but no dice. When I press the save button, it does not close the form which it what I want, but it resets to a blank form which is what I guess the intention of the NewForm(SharePointForm1) command is.

 

After playing with it bit more I have the following in my arguments:

AdriaanOlivier_1-1610926699687.png

I am not sure if leaving the OnSuccess field blank is a good idea but changing the highlighted part of the argument in the item box from "First" to "Last" seems to work as I want.

 

If anybody can tell me if this will become an issue later on as the list grows it will be great.

 

Thanks

Hi @AdriaanOlivier :

   Do you want to submit a custom form without closing it?

   I have tried many methods, as long as the SubmitForm() function is used, the RequestHide function will be triggered to close the form. This seems to be a built-in function and we cannot change it.

   To avoid this situation, I suggest you use Patch() instead of SubmitForm.For example:

1\Set the SharePointIntegration's OnSave Property to

If(
  IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),
  Patch(ListA,Defaults(ListA),SharePointForm1.Updates),
  Patch(ListA,SharePointIntegration.Selected,SharePointForm1.Updates)
);/*ListA is my list*/
ResetForm(SharePointForm1)

1.JPG

The Result

35.gif

We can find that:

  • The form will not be closed immediately after clicking save
  • The data in the list has actually been modified, but it will not be displayed immediately. You can hit "F5" to refresh the page to display the latest data

Best Regards,

Bof

 

 

 

 

It can cause an issue in the following scenario:

  1. User A saves a new item to the list and continues working in the item. Powerapps saves the item and resets the form with the Last item in the list which is the item User A just saved. (All good so far)
  2. User B saves a new item to the list while User A is still working in their item. Powerapps saves the item and resets the form with the Last item in the list which is the item User B just saved. (Still good here)
  3. User A saves new changes to their item. Powerapps saves the changes and resets the form with the Last item in the list which is the item User B saved. (User A is now editing User B's item)

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,982)