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?

  • Suggested answer
    Dishant Sharma Profile Picture
    30 on at
    RE: how to recognize if a record belongs to which entity?

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

  • Verified answer
    Leah Ju Profile Picture
    Microsoft Employee on at
    RE: how to recognize if a record belongs to which entity?

    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
    XM-22040801-0 Profile Picture
    11 on at
    RE: how to recognize if a record belongs to which entity?

    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

  • Dishant Sharma Profile Picture
    30 on at
    RE: how to recognize if a record belongs to which entity?

    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
    BillurSamdancioglu Profile Picture
    17,153 Most Valuable Professional on at
    RE: how to recognize if a record belongs to which entity?

    Hi,

    You may use dataareaid.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,280 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,034 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans