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 / Patch function to upda...
Power Apps
Answered

Patch function to update multiple forms

(0) ShareShare
ReportReport
Posted on by 239

Hello,

 

I have an app (SP Integrated form) that is spread across multiple screens. To submit everything to my list at once and to create only one record, I've used the Patch function. 

My code is 

Patch(STARS,Defaults(STARS),'STARS Form'.Updates,'STARS Form_1'.Updates,'STARS Form_2'.Updates,'STARS Form_3'.Updates,'STARS Form_4'.Updates,'STARS Form_5'.Updates);Navigate(ThankYouScreen,ScreenTransition.Fade)

 

I need to understand how to modify the code above in order for EDITS to be patched in the same way. Currently, when a user edits their record, it creates a new record in my sharepoint list .

 

Thank you for your help!  

Categories:
  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    The Defaults(STARS) parameter needs to be change to the record that needs to be updated. My guess is that the record is the same has what is listed the Item property of 'STARS Form'.

    Example: gallery.selected

  • AuburnMist Profile Picture
    239 on at

    Hello, 

     

    The Items property of the Stars form (all of them) is varRecord. 

    If I need to replace the "Defaults(STARS)" section of the code with the record that needs to be updated, how do I do that?

     

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @AuburnMist

    A Patch() has 3 elements, the datasource, the record to be patched, and the values to be patched.  Defaults(datasource) is the second element and means that a new record is created.  Since you are using several forms, I suggest creating a global variable for the OnVisible property of the screen and then using 

    Set(selectedLookupItem, LookUp(YourSharepointIntegrationObject, ID=SharePointIntegration.SelectedListItemID ))
    So

    Patch(STARS, selectedLookupItem, ...)

     

  • Verified answer
    Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    If varRecord is the record that needs to be updated then your Patch for updating would look like this:

    Patch(STARS,varRecord,'STARS Form'.Updates,'STARS Form_1'.Updates,'STARS Form_2'.Updates,'STARS Form_3'.Updates,'STARS Form_4'.Updates,'STARS Form_5'.Updates);Navigate(ThankYouScreen,ScreenTransition.Fade)

     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 226 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 191 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 167

Last 30 days Overall leaderboard