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

Retail values in the form after patch

Hello,

 

I have number of applications that use patch function to save values of the form back to the SharePoint list.  I simply use "SAVE DRAFT" button that executes formMyform.updates as part of my patch process.  After the patch is complete, the values stay on the screen so user can continue with processing data in the applications on other screens.

 

Unfortunately, about 3 weeks ago the behavior of the patch function has changed.  Now, instead of retaining the values of on the screen the patch function writes the values to the Sharepoint list, as it should, but it resets the form which break the rest of the app that uses that data.

 

I have some frustrated users, and I am at a loss of how to fix this.  Please help!

 

Appreciate any responses in advance!

 

Leon.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Retail values in the form after patch

Hi @Leonarius,

Do you want to retain the submitted record (submit using Patch function) within the Edit form in your app?

Could you please share a screenshot about your app's configuration?

Based on the needs that you mentioned, I think a global variable could achieve your needs.

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

 

7.JPG

 

8.JPG

Set the OnVisible property of the Edit screen to following:

Set(CurrentSubmittedRecord, Blank())

Set the OnSelect property of the "SAVE DRAFT" button to following:

If(
    IsBlank(CurrentSubmittedRecord),
    Set(CurrentSubmittedRecord, Patch('20190211_case5', Defaults('20190211_case5'), EditForm1.Updates)), /* <-- EditForm1 represents the Edit form in my Edit screen */
    Set(CurrentSubmittedRecord, Patch('20190211_case5', CurrentSubmittedRecord, EditForm1.Updates))
);
EditForm(EditForm1)

On your side, you should type:

If(
    IsBlank(CurrentSubmittedRecord),
    Set(CurrentSubmittedRecord, Patch('YourSPList', Defaults('YourSPList'), formMyform.Updates)), /* <-- formMyform represents the Edit form in your Edit screen */
    Set(CurrentSubmittedRecord, Patch('YourSPList', CurrentSubmittedRecord, formMyform.Updates))
);
EditForm(formMyform)

Set the Item property of the Edit form to following:

If(
    IsBlank(CurrentSubmittedRecord),
    BrowseGallery1.Selected,
    CurrentSubmittedRecord
)

On your side, you should type:

CurrentSubmittedRecord

Please check the attached GIF screenshot for more details:

 

Note: If you want to reference the submitted record within your Edit form, please reference the CurrentSubmittedRecord variable value.

 

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.
3 REPLIES 3
AndySid
Level 8

Re: Retail values in the form after patch

This sounds like an issue that is talked a lot about, a solution and why this happened by Staff here.

 



https://powerusers.microsoft.com/t5/General-Discussion/Issue-with-new-Powerapps-version-3-19014-8-Dr...

 

>>If you found this reply helpful, please mark this as the answer to close the topic and make it easier to find for other people with similar questions.<<

Community Support Team
Community Support Team

Re: Retail values in the form after patch

Hi @Leonarius,

Do you want to retain the submitted record (submit using Patch function) within the Edit form in your app?

Could you please share a screenshot about your app's configuration?

Based on the needs that you mentioned, I think a global variable could achieve your needs.

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

 

7.JPG

 

8.JPG

Set the OnVisible property of the Edit screen to following:

Set(CurrentSubmittedRecord, Blank())

Set the OnSelect property of the "SAVE DRAFT" button to following:

If(
    IsBlank(CurrentSubmittedRecord),
    Set(CurrentSubmittedRecord, Patch('20190211_case5', Defaults('20190211_case5'), EditForm1.Updates)), /* <-- EditForm1 represents the Edit form in my Edit screen */
    Set(CurrentSubmittedRecord, Patch('20190211_case5', CurrentSubmittedRecord, EditForm1.Updates))
);
EditForm(EditForm1)

On your side, you should type:

If(
    IsBlank(CurrentSubmittedRecord),
    Set(CurrentSubmittedRecord, Patch('YourSPList', Defaults('YourSPList'), formMyform.Updates)), /* <-- formMyform represents the Edit form in your Edit screen */
    Set(CurrentSubmittedRecord, Patch('YourSPList', CurrentSubmittedRecord, formMyform.Updates))
);
EditForm(formMyform)

Set the Item property of the Edit form to following:

If(
    IsBlank(CurrentSubmittedRecord),
    BrowseGallery1.Selected,
    CurrentSubmittedRecord
)

On your side, you should type:

CurrentSubmittedRecord

Please check the attached GIF screenshot for more details:

 

Note: If you want to reference the submitted record within your Edit form, please reference the CurrentSubmittedRecord variable value.

 

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.
Leonarius
Level: Powered On

Re: Retail values in the form after patch

Thank you for your help!

 

What I doing differently, was checking for a value of a variable in the "Item" property. I changed as per your suggestion to check if record is empty of not and it works!

 

If(
IsBlank(IPRecord),
myRequestsGallery.Selected,
IPRecord
)

 

vs. what I had:

If(
(resumeDraft || copyNDAitem),
myRequestsGallery.Selected,

IPRecord
)

 

I don't know why it wokred before, and stoped.  But it's working now! 

 

Now I have a fun task to update about a dozen apps!

 

Many thanks for your help!