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

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.

 

@Anonymous

Highlighted
Helper II
Helper II

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

Highlighted
Helper II
Helper II

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,794)