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
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.

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

Highlighted
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
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: 168 members 5,212 guests
Please welcome our newest community members: