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

How to get the GUID of the newly created d365 record in powerapps?

Hi Folks!

 

I am a beginner in using powerapps.

 

How would I get the GUID of the newly created d365 record in powerapps?

 

The scenario is I have 2 screens (1st is where I create the record. 2nd is where I will associate records to the newly created record).

 

Thanks in advance!

 

Marvin

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: How to get the GUID of the newly created d365 record in powerapps?

If you are using a Form, you can use the LastSubmitted property to access the values of the fields of the last record submitted.

With Patch you can set a variable as the output of the record, e.g.
Set(varNewID,Patch(MyTable,Defaults(MyTable),{Field1:MyValue1, Field2: MyValue2}).ID

4 REPLIES 4
Administrator
Administrator

Re: How to get the GUID of the newly created d365 record in powerapps?

Hi @marvinbarnuevo thanks for posting in the community. This response should answer your question:

 

We have added a function that returns new GUIDs.  Simply call GUID() with no arguments.  More information is available in the reference docs.

 

As the docs describe, we don't yet support reading/writing GUIDs as a proper GUID data type from CDS or SQL yet, but that is coming.  You still have to interact with databases with GUIDs stored in strings for the time being.

 

@TopShelf-MSFT

marvinbarnuevo
Level: Powered On

Re: How to get the GUID of the newly created d365 record in powerapps?

Hi,

 

Thanks for your reply.

 

As per my understanding, calling GUID() will just return random GUID instead of returning the GUID of the record I created in Dynamics 365 via PowerApps.

Super User
Super User

Re: How to get the GUID of the newly created d365 record in powerapps?

If you are using a Form, you can use the LastSubmitted property to access the values of the fields of the last record submitted.

With Patch you can set a variable as the output of the record, e.g.
Set(varNewID,Patch(MyTable,Defaults(MyTable),{Field1:MyValue1, Field2: MyValue2}).ID

marvinbarnuevo
Level: Powered On

Re: How to get the GUID of the newly created d365 record in powerapps?

That's great to know, Paul! Thank you!

 

Unfortunately, I am using a Gallery. Does that have the same functionality as you mentioned?

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

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

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

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

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 19 members 4,274 guests
Please welcome our newest community members: