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

Community site session details

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

WebAPI field/attribute names, logical or shema?

(0) ShareShare
ReportReport
Posted on by 5

Hi

I am currently create oData queries dynamically to get data out of dataverse.  The problem I have is the name for each field/attribute that you specify in the $select query seems to change betweek LogicalName and SchemaName.  Is there a way to determine when to use logical and when to use schema?  For example, the following query has to use logical for createdby but schema for CreatedByExternalParty

xxx.crm11.dynamics.com/.../accounts(27cacceb-2a0b-ec11-b6e5-0022484220b6) name &$expand= createdby ( $select= fullname ), CreatedByExternalParty ( $select= fullname )

If I query the EntityDefinition for each of the above two fields, I can't any difference between them in terms of metadata:

"@odata.type": "#Microsoft.Dynamics.CRM.LookupAttributeMetadata",
"Targets": [
"externalparty"
],
"Format": "None",
"AttributeOf": null,
"AttributeType": "Lookup",
"ColumnNumber": 230,
"DeprecatedVersion": null,
"IntroducedVersion": "8.0.0.0",
"EntityLogicalName": "account",
"IsCustomAttribute": false,
"IsPrimaryId": false,
"IsValidODataAttribute": true,
"IsPrimaryName": false,
"IsValidForCreate": false,
"IsValidForRead": true,
"IsValidForUpdate": false,
"CanBeSecuredForRead": false,
"CanBeSecuredForCreate": false,
"CanBeSecuredForUpdate": false,
"IsSecured": false,
"IsRetrievable": false,
"IsFilterable": false,
"IsSearchable": false,
"IsManaged": true,
"LinkedAttributeId": null,
"LogicalName": "createdbyexternalparty",
"IsValidForForm": true,
"IsRequiredForForm": false,
"IsValidForGrid": true,
"SchemaName": "CreatedByExternalParty",
"ExternalName": null,
"IsLogical": false,
"IsDataSourceSecret": false,
"InheritsFrom": null,
"CreatedOn": "1900-01-01T00:00:00Z",
"ModifiedOn": "1900-01-01T00:00:00Z",
"SourceType": null,
"AutoNumberFormat": "",
"MetadataId": "827e9002-b547-49fc-9e8d-a6b1cfcef33b",
"HasChanged": null,
"AttributeTypeName": {
"Value": "LookupType"
},

"@odata.type": "#Microsoft.Dynamics.CRM.LookupAttributeMetadata",
"Targets": [
"systemuser"
],
"Format": "None",
"AttributeOf": null,
"AttributeType": "Lookup",
"ColumnNumber": 52,
"DeprecatedVersion": null,
"IntroducedVersion": "5.0.0.0",
"EntityLogicalName": "account",
"IsCustomAttribute": false,
"IsPrimaryId": false,
"IsValidODataAttribute": true,
"IsPrimaryName": false,
"IsValidForCreate": false,
"IsValidForRead": true,
"IsValidForUpdate": false,
"CanBeSecuredForRead": false,
"CanBeSecuredForCreate": false,
"CanBeSecuredForUpdate": false,
"IsSecured": false,
"IsRetrievable": false,
"IsFilterable": false,
"IsSearchable": false,
"IsManaged": true,
"LinkedAttributeId": null,
"LogicalName": "createdby",
"IsValidForForm": true,
"IsRequiredForForm": false,
"IsValidForGrid": true,
"SchemaName": "CreatedBy",
"ExternalName": null,
"IsLogical": false,
"IsDataSourceSecret": false,
"InheritsFrom": null,
"CreatedOn": "1900-01-01T00:00:00Z",
"ModifiedOn": "1900-01-01T00:00:00Z",
"SourceType": null,
"AutoNumberFormat": "",
"MetadataId": "b863fe8a-6393-42ec-a540-972d3b45bd7b",
"HasChanged": null,
"AttributeTypeName": {
"Value": "LookupType"
},

Any help would be great, thanks.

I have the same question (0)
  • Verified answer
    Guido Preite Profile Picture
    54,084 Moderator on at
    RE: WebAPI field/attribute names, logical or shema?

    you can use my tool Dataverse REST Builder to generate the queries

    to reply to your question, the fields/columns always use the logicalname (all lowercase) the relationship names (that you need to put inside the expand part) use the schema name, for some relationships the schema name is also all lowercase so it may be confused with the logical name

  • Suggested answer
    byst Profile Picture
    5 on at
    RE: WebAPI field/attribute names, logical or shema?

    Thanks Guido, your tool is great and reading the source code helped me. I found the answer from your code, the casing of the CreatedByExternalParty comes from the navigation property when calling RelationshipDefinitions.

    /api/data/v9.0/RelationshipDefinitions/Microsoft.Dynamics.CRM.OneToManyRelationshipMetadata?$filter=SchemaName eq 'lk_externalparty_account_createdby'

    response:

    "ReferencingEntityNavigationPropertyName": "CreatedByExternalParty",

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Sahan Hasitha Profile Picture

Sahan Hasitha 169

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 67 Super User 2025 Season 2

#3
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 65

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans