web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / When Patching a new fo...
Power Apps
Answered

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

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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.

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Anonymous,

     

    What did the screen look like two days ago?   

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks for replying.

     

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

     

    Thank you,

    Leon.

  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    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)).  

  • iamlee Profile Picture
    121 on at

    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. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 305 Most Valuable Professional

#2
11manish Profile Picture

11manish 212

#3
Valantis Profile Picture

Valantis 167

Last 30 days Overall leaderboard