cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
marvinbarnuevo
Helper II
Helper II

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
PaulD1
Super User
Super User

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
Anonymous
Not applicable

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.

 

@Anonymous

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.

PaulD1
Super User
Super User

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

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,178)