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

How to create Unique Identifier in CDS?

Hi All,

We have requirement like onclick of a custom button in model driven app need to pass curent data to create a copy of that data with updated staus. But am strucked to create an unique identifier in CDS to get record in flow. Kindly help me on this. Thanks in Advance!!!

1 ACCEPTED SOLUTION

Accepted Solutions
hari
Level: Powered On

Re: How to create Unique Identifier in CDS?

Found solution!! Created an AutoNumber field and customized it by removing the prefix and started with single digit its worked as like SQL  primary key.. Thanks for the support.

View solution in original post

13 REPLIES 13
Dual Super User
Dual Super User

Re: How to create Unique Identifier in CDS?

HI @hari 

 

Can you please share more details on this? Maybe a screenshot? If you are trying to access the ID for a particluar record in an action post the When a record is updated, you can get the ID by typing the name of the entity in the dynamic selector (This is for MS Flow). If you can share more details on the scenario, we might be able to assist you better. 

hari
Level: Powered On

Re: How to create Unique Identifier in CDS?

@yashag2255  thanks for your response. I have created a custom button using HTML webresources and in that click event, want to trigger the flow to get the record. But in Flow for get item in CDS its asking an ID i.e Identifier. So how/ where to find this ID of the Item in CDS. I have attached the flow image for your reference.

 

Thanks!!

Dual Super User
Dual Super User

Re: How to create Unique Identifier in CDS?

Hi @hari 

 

Can you please share details on the entire scenario that you are trying to buiild? 

 

1. Where is this custom HTML button? (on a record? form? view? dashboard?)

2. If on a record/view/form, is there any specific reason you are not using the flow button that is already avaialble?

3. Please note that Get Record needs the ID of the record that you want to get. You can do this: use the list records action and in the filter query, use the odata filter to get the record and then use the get record action and reference the record id from the list records action. Makes sense?

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

hari
Level: Powered On

Re: How to create Unique Identifier in CDS?

@yashag2255just for now i want get an item id of the CDS Item how I can do it.. Is there any specific column for that we need to create. And note am asking it for Model driven apps not for the Canvas app. 

Dual Super User
Dual Super User

Re: How to create Unique Identifier in CDS?

Hi @hari 

Yes, I undersatnd that it is a Model Driven app and you can find the Flow button to start a flow when the record is selected so that you can get the record Id.

 

Note: You don't have to create a column to get the record ID as the field already exists. In the flow to get the record you need to provide the id (identifier) so either you should have the GUID of that record or else you need to use the List records action and then get it using the filter queries.

 

You can see the record ID by going to the entity and view data and change to all fields. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

hari
Level: Powered On

Re: How to create Unique Identifier in CDS?

Yes correct, My scenario is like I have created a HTML webresource which contains 2 text fields and a button and add this web resource to my form. Now, I want to update an item of the exisiting record using flow by passing the ID of the item by the my webresource button click. Is this possible?

Dual Super User
Dual Super User

Re: How to create Unique Identifier in CDS?

@hari 

 

The existing record that you want to update, does it have any unique field that can be filled by the user who is giving the two inputs before running the flow? 

hari
Level: Powered On

Re: How to create Unique Identifier in CDS?

Currently I don't have it, Thats why am asking how to create the Unique field in the CDS that will help in the feature.




 

Dual Super User
Dual Super User

Re: How to create Unique Identifier in CDS?

@hari 

 

Let's not get confused here. A short example:

Let's assume you have an entity named Cars. Cars has a field Name, Model. You create a record in the cars entity: Mercedes; when you create this record a unique identifier guid is generated automatically and it is like a key to access this record. The flow action Get a record wants you to reference this key as an identifier to get the record Mercedes. (Makes Sense?)

 

Now, you have your HTML resource and there in the input you enter some value for the Model and you want to update the Mercedes record with that model field too. So, if the Mercedes name is a unique value in the cars entity, you can add the list records action in your flow and in the filter query, put Name eq 'Mercedes' this will get records that have the name Mercedes (assuming that Mercedes is unique, it will return only one record) and here you will also get the GUID of the mercedes record and then in the action Update Record, you can use this GUID to update the existing record. Makes sense?

 

Hope this Helps!

 

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: 85 members 5,278 guests
Please welcome our newest community members: