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 / Problem with multiple ...
Power Apps
Answered

Problem with multiple patches to multiple SharePoint Lists from a single PowerApps Canvas app

(0) ShareShare
ReportReport
Posted on by

Hi,

I want to do two patches from a PowerApps canvas app to SharePoint and I want to get the ID(generated by the SharePoint list while saving a new record) of the record saved using the first patch and pass it as a value to the second patch.

eg,

First_patch=Patch(

DataSource1,

{col1:val1}

);

Patch(

DataSource2,

{col1:First_Patch.ID}

);

How can this be done? Any ideas? Thanks in advance.

@Drrickryp @mdevaney @WarrenBelz

Categories:
I have the same question (0)
  • Verified answer
    Michael E. Gernaey Profile Picture
    53,968 Super User 2026 Season 2 on at

    @michaeldanieal 

     

    Hi , you can do it one of 2 ways.

     

    Anytime you patch you can get the data back (in the form of the New record by doing either)

     

    ClearCollect(PatchResult, Patch(Table, Defaults(Table) { stuff here: }));
    
    Then to get the ID 
    First(PatchResult).ID or ColumnName 
    
    Or you can do a 
    Set(PatchResult, Patch(Table, Defaults(Table) { stuff here: }));
    And then do 
    
    PatchResult.Id / ColumnName
    
    Now I am not 100% if the issue is truly fully resolved but for a very long time doing Set, didn't always populate correctly and ClearCollect does. 
    
    Or you can do a With Statement as well and avoid variables, but the top 2 there work.
    


    If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • elseb Profile Picture
    774 Moderator on at

    Hi,

     

    Set(varFirstPatchID, Patch(sp_list, Defaults(sp_list),{column:"some_value"}).ID)

     

    varPatchID will store the id of the first patch

     

    Seb

  • michaeldanieal Profile Picture
    on at

    Thank you, your solution worked exactly as you described.

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 396 Most Valuable Professional

#2
11manish Profile Picture

11manish 134 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 101 Super User 2026 Season 2

Last 30 days Overall leaderboard