web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

how to recognize if a record belongs to which entity?

(0) ShareShare
ReportReport
Posted on by 30

I have a collection of records from different entities. I want to find the field name which contains the unique identifier for the particular record belonging to any entity. 

Is there an API that can accept something like record type and return which is the unique identifier for that entity type?

Basically, I have to perform some kind of action based on unique identifier field of the entity?

I have the same question (0)
  • Suggested answer
    BillurSamdancioglu Profile Picture
    19,703 Most Valuable Professional on at

    Hi,

    You may use dataareaid.

  • Dishant Sharma Profile Picture
    30 on at

    Thank you so much for the reply. Actually, this field is not available in all entities. I tried looking it up in the knowledge article entity, but couldn't find it. Is there any other way or particular field which is universal to all the tables for achieving the same thing?

  • Suggested answer
    XM-22040801-0 Profile Picture
    11 on at

    Hi,

    What language and king of application do you use?

    To get the PrimaryIdAttribute from the entity name, you can use this WebAPI request:

    /api/data/v9.1/EntityDefinitions(LogicalName='account')?$select=PrimaryIdAttribute

    To learn more, see: learn.microsoft.com/.../query-metadata-web-api

  • Verified answer
    Leah Ju Profile Picture
    Microsoft Employee on at

    Hi Dishant,

    Each definition entity type uses MetadataId as the unique identifier property, which it inherits from the MetadataBase EntityType

    https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/use-web-api-metadata 

    Because the MetadataId is the primary key for definition items, retrieving individual items follows the same pattern used to retrieve business data tables.

    GET /api/data/v9.0/EntityDefinitions(<Entity MetadataId>)

    Refer to the following link for more details:

    https://learn.microsoft.com/en-us/power-apps/developer/data-platform/webapi/retrieve-metadata-name-metadataid#retrieve-definition-items-by-metadataid 

  • Suggested answer
    Dishant Sharma Profile Picture
    30 on at

    Thank you so much for the reply. It actually solved my issue.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 60 Most Valuable Professional

#2
#ManoVerse Profile Picture

#ManoVerse 51

#3
Satyam Prakash Profile Picture

Satyam Prakash 42

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans