Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Web API query using $expand and related entities

Posted on by 245

Hi,

Is there a way in Web API to include the related entities in a single query without performing the @data.nextLink, for example if I issue the following request

localhost:5555/.../contacts eq '4200722132'&$expand=mli_contact_accountregistration_registrantaccountid

I want to see the related mli_contact_accountregistration_registrantaccountid records in the payload without issuing another request to the following link

  • RE: Web API query using $expand and related entities

    Web API doesn't support INNER join, so instead of using OData filter expression, I used the expression /contacts(guid) and use the $expand

  • kokane Profile Picture
    kokane on at
    RE: Web API query using $expand and related entities

    Thank you PG.  FetchXMLBuilder  is a good tool.

  • Verified answer
    Pankaj Gogoi Profile Picture
    Pankaj Gogoi 3,177 on at
    RE: Web API query using $expand and related entities

    Hi Benjamin,

    Good you are able to resolve it. For reference, you can also use the FetchXMLBuilder to generate oData queries from FetchXML

    pastedimage1598348255666v1.png

    Best Regards

    PG

  • Verified answer
    RE: Web API query using $expand and related entities

    Got it already!

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans