cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
rajmilansinh
Level: Powered On

How to get created record id from patch function ?

I want to get record Id which is created by Patch function from PowerApps.

Is there any way to get that record Id so that I can use that Id to set in another record's lookup field

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: How to get created record id from patch function ?

Hi @rajmilansinh 

The return value from Patch will include any server generated values. The code in the following post might be of interest to you...

 

https://powerusers.microsoft.com/t5/General-Discussion/Retrieve-an-ID-from-SQL-table-after-patching-...

 


 

The return value from Patch includes any server generated identity values. If you did this for example,

ClearCollect(NewCompany,
             Patch('[dbo].[tblCompany]',Defaults('[dbo].[tblCompany]'),{Name: TextInput1.Text})
)

... you could use NewCompany.ID to retrieve the identity value that SQL Server generates.

 


View solution in original post

1 REPLY 1
Super User
Super User

Re: How to get created record id from patch function ?

Hi @rajmilansinh 

The return value from Patch will include any server generated values. The code in the following post might be of interest to you...

 

https://powerusers.microsoft.com/t5/General-Discussion/Retrieve-an-ID-from-SQL-table-after-patching-...

 


 

The return value from Patch includes any server generated identity values. If you did this for example,

ClearCollect(NewCompany,
             Patch('[dbo].[tblCompany]',Defaults('[dbo].[tblCompany]'),{Name: TextInput1.Text})
)

... you could use NewCompany.ID to retrieve the identity value that SQL Server generates.

 


View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 187 members 5,951 guests
Please welcome our newest community members: