Showing results for 
Search instead for 
Did you mean: 
Level: Powered On

Get ID after creating new record with Patch()

I have offline mode working in my app but I need to extend it. When offline it will save new records into a collection and the trigger control will Patch them to a SharePoint List when it's back online. This all works just fine, but I need to add new functionality.


Currently, once a new record is created while ONLINE, I have an Azure function + custom connector that will attach a file to the SharePoint List that was just created. One of it's parameters is the ID of the newly created record. While ONLINE, I can get the ID from the EditForm.LastSubmit.ID property. So that works fine. However, while the app is returning to an ONLINE state and there are records stored in the offline collection, the timer will run through each of the stored records and patch them to the SharePoint data source. However, I'm not sure how to obtain the ID of the newly created record so that I can make the subsequent call to my Azure function. Here's what my (simplified) code looks like now:


ForAll(LocalItemsToPost, Patch(SharePointList, Defaults(SharePointList), {
  Col1: Col1,
  Col2: Col2,
  Col3: Col3


Any suggestions on how to tackle this? Thanks.

Level 8

Re: Get ID after creating new record with Patch()

I cannot understand what you are trying to do, can you take some screenshots of your app maybe?

Level: Powered On

Re: Get ID after creating new record with Patch()

I also have the same issue. Did you ever identify a solution to this?


I am moving my powerapps from form submissions, to patch functions, however in my submitform() i refered to a previous form with .lastsubmit and was then able to access the properties within it.

Helpful resources


Watch Sessions On Demand!

Continue your learning in our online communities.


Follow PowerApps on Twitter

Stay Up-to-Date by following PowerApps on Twitter

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020


Power Platform World Tour

Coming to a city near you


PowerApps Community User Group Member Badge

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


Join PowerApps User Group!!

Connect, share, and learn with your peers year-round


Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Top Kudoed Authors
Users Online
Currently online: 40 members 4,443 guests
Please welcome our newest community members: