Search code examples
dynamics-crmodatamicrosoft-dynamicspowerapps

Odata query expand grandchild in Dynamics


I have the following simple data structure:

Advance

  • Advancing groups - Advancing Recipients
  • Job
  • Location

I need to retrieve all advances and their Job, Location and Advancing Recipients details.

I can expand to the job, Location and Advancing group but I can't get back any details about the Recipients. Is there an odata flag that I need to use too expand to Grandchild?


Solution

  • What have you tried? Why isn't it working?

    What have you searched?

    Where are you using the query?

    The following is straight from the docs:

    GET [Organization URI]/api/data/v9.1/tasks?$select=subject
    &$expand=regardingobjectid_contact_task($select=fullname;
     $expand=parentcustomerid_account($select=name;
      $expand=createdby($select=fullname))) HTTP/1.1  
    Accept: application/json  
    OData-MaxVersion: 4.0  
    OData-Version: 4.0  
    

    https://learn.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/retrieve-related-entities-query