cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

When Patching a new form, patch is reset after patch is successful.

I started to have a strange problem.  I have a "Save Draft" functionality in my app and it workded as expected until today.

 

If the Item is new, I patch the Item to SharePoint with the following code:

 

UpdateContext({
            AccidentRecord: Patch(
                AccidentReporting,
                Defaults(AccidentReporting),
                formaccidentinfo.Updates,
                formpersonnellInfo.Updates,
                formTypeOfIncident.Updates,
                formIncident.Updates,
                formCause.Updates,
                formRCA.Updates,
                formCorrectiveAction.Updates,
                {
                    Status: {
                        '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
                        Value: "Draft"
                    }
                },
                {EmployeeWOEmail: inputTempEmployee.Text}
            )
        })

The patch works, but for some reason, the screen is now reset and all field are blank.  Again, this worked as a charm 2 days ago.

 

Any help on this would be greatly appreciated!

 

Thank you,

Leon.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: When Patching a new form, patch is reset after patch is successful.

Hi Leon, I don't know why the behavior of your screen changed.  Am I correct in thinking that you want to see the results of your patch?  If so, you could put a View form on your screen and set its DataSource to AccidentReporting and the Item property to First(Sort(AccidentReporting,ID,Descending)).  

View solution in original post

5 REPLIES 5
Super User
Super User

Re: When Patching a new form, patch is reset after patch is successful.

Hi @Anonymous,

 

What did the screen look like two days ago?   

Anonymous
Not applicable

Re: When Patching a new form, patch is reset after patch is successful.

Thanks for replying.

 

Few days ago, the screen would just retain the values that user would enter before saving.

 

Thank you,

Leon.

Super User
Super User

Re: When Patching a new form, patch is reset after patch is successful.

Hi Leon, I don't know why the behavior of your screen changed.  Am I correct in thinking that you want to see the results of your patch?  If so, you could put a View form on your screen and set its DataSource to AccidentReporting and the Item property to First(Sort(AccidentReporting,ID,Descending)).  

View solution in original post

iamlee
Level 8

Re: When Patching a new form, patch is reset after patch is successful.

did you manage to fix it? I am experiencing the same when there's multiple edit forms, I think patch is resetting the forms for some reason. 

Anonymous
Not applicable

Re: When Patching a new form, patch is reset after patch is successful.

Yes, I resolved it.

 

Long story short, I set the Default Mode to "formmode.edit" and changed the "item" property to 

 

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

 

This way, if this is a resumtion of draft it will re-reload items from the selected item.

 

Hope this helps!

 

Leon.

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,051)