cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Highlighted
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

View solution in original post

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.

Highlighted
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

View solution in original post

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

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

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

Top Kudoed Authors
Users Online
Currently online: 359 members 2,806 guests
Please welcome our newest community members: