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 CRM (Archived)

WEB API query expanding a related entity

(0) ShareShare
ReportReport
Posted on by 19

Hi!

I spent 2-3 hours yesterday scratching my head and wondering why this API query would not work.

http://....dynamics.com/api/data/v9.1/st_intakes?$filter=st_name eq 'IN00000009'&$select=st_name&$top=3&$expand=st_nameofthechildyouth

This field is clearly listed as a related entity. I checked the field definition in Settings/customization and the spelling was correct.

pastedimage1566391448629v1.png

I also tried the same query but replacing the expanded field with  &$expand=_st_nameofthechildyouth_value

no luck either.

Then I used the XRM toolbox 'Attribute Manager' module and discovered the field is actually spelled 'st_NameoftheChildYouth'. So I tried the query again and long and behold...

http://....dynamics.com/api/data/v9.1/st_intakes?$filter=st_name eq 'IN00000009'&$select=st_name&$top=3&$expand=st_NameoftheChildYouth 

worked!  Alright. I figured out the field is case sensitive. But my question is: Where....in CRM 'Settings/customization', looking at the field list for my Entity, can I see the exact case spelling of this field? Currently when I look at it, it is spelled in lowercase.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    boulerm Profile Picture
    19 on at

    I think I found it now... It might be the 'schema name'.

  • Verified answer
    Flydancer Profile Picture
    1,332 on at

    Yes, some methods like expand are working with the schemaname instead of the logicalname. Have a look at the examples on docs.microsoft.com/.../query-metadata-web-api where it shows when to use which

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 CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans