Search code examples
dynamics-crmcrmdynamics-crm-online

How to retrieve field values and its translations from Microsoft dynamics CRM using REST API


I need to retrieve the entities from my CRM site and all the fields associated with that entity. Need to get the translated values as well.

Please provide some queries that will be helpful in this case

I tried with below queries, but this could not fetch all the values.

  • ..../api/data/v9.1/EntityDefinitions(LogicalName='account')/Attributes/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?$select=LogicalName&$expand=OptionSet,GlobalOptionSet
  • ..../api/data/v9.1/EntityDefinitions(LogicalName='account')/Attributes
  • ..../api/data/v9.1/GlobalOptionSetDefinitions

Solution

  • You can retrieve CRM entities by calling:

    [Organization URI]/api/data/v9.1/

    In order to get an entity's attributes you can call:

    [Organization URI]/api/data/v9.1/EntityDefinitions(LogicalName='[Entity name (ex: account)]')/Attributes

    For attribute translation, navigate to 'DisplayName' you will find 'LocalizedLabels'.

    For more information you can check this url: https://learn.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/query-metadata-web-api