Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Unanswered

$Expand does not expand all cases

Posted on by

I have table with contacts in d365, some of them have expandable fields, aka expandable field is not null.

For example, also the problem:
API call

https://yyy.crm4.dynamics.com/api/data/v9.2/contacts?$filter=(yyy_tag_contact_ent/any(s%3A%20s/yyy_name%20eq%20'Agent'))&$expand=yyy_tag_contact_ent($select%3Dyyy_name)

 

returns 11 cases of contacts with expandable yyy_tag_contact_ent field, where yyy_name = 'Agent'

and one of those contacts is contactid = 001, others are contactid =002..011

But when I do API call

https://yyy.crm4.dynamics.com/api/data/v9.2/contacts?$expand=yyy_tag_contact_ent($select%3Dyyy_name)

I get all contacts, also those who has not expandable yyy_tag_contact_ent field, but only contactid=002..011 get yyy_tag_contact_ent field expanded, while contactid = 001 has null /yyy_tag_contact_ent/: []. Yet next field /yyy_tag_contact_ent@odata.nextLink/: /https://yyy.crm4.dynamics.com/api/data/v9.2/contacts(001)/yy_tag_contact_ent?$select=yyy_name/ , gives correct result.

And when I filter only contactid=001
https://yyy.crm4.dynamics.com/api/data/v9.2/contacts?$filter=(contactid%20eq%20001&$expand=yyy_tag_contact_ent($select%3Dyyy_name)
I also get correct result with expandable
yyy_tag_contact_ent field.

Endpoint
https://yyy.crm4.dynamics.com/api/data/v9.2/yyy_tags?$expand=yyy_tag_contact_ent
 has only yyy_name = Agent with expandable yyy_tag_contact_ent field


Where is the problem?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans