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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Query OrgChart data using WebAPI

(3) ShareShare
ReportReport
Posted on by 16
I'm trying to query OrgChart (Contacts Manager and Direct Reports) data using the WebAPI. I see the entity "msdyn_orgchartnode" where I can get the Contacts and their Accounts. And I see the N:N relationship called "contact_msdyn_orgchartnode_msdyn_noderecord" with the connection to the child Contacts. How can I create a Fetch/OData query to retrieve these records?
 
Screenshot showing direct reports in an org chart hierarchy.
Categories:
I have the same question (0)
  • Suggested answer
    Muhammad Shahzad Shafique Profile Picture
    2,373 Most Valuable Professional on at
    To retrieve OrgChart data (Contacts with their Direct Reports) via Web API, use the msdyn_orgchartnode entity and expand the N:N relationship contact_msdyn_orgchartnode_msdyn_noderecord.
    GET /api/data/v9.2/msdyn_orgchartnodes?$expand=contact_msdyn_orgchartnode_msdyn_noderecord($select=fullname,contactid)&$select=msdyn_name,msdyn_OrgChartNodeId
    

    This query returns OrgChart nodes with their related child contacts (direct reports).

     

    Note: The N:N relationship must be correctly configured and populated. If no data is returned, verify associations via Advanced Find or the relationship mappings.

     
  • Suggested answer
    Hamza H Profile Picture
    1,807 on at
    To retrieve OrgChart data (contacts and their direct reports) via Web API, query the msdyn_orgchartnode entity and expand the N:N relationship contact_msdyn_orgchartnode_msdyn_noderecord:
    GET /api/data/v9.2/msdyn_orgchartnodes?
      $select=msdyn_name,msdyn_OrgChartNodeId&
      $expand=contact_msdyn_orgchartnode_msdyn_noderecord($select=fullname,contactid)

    This returns OrgChart nodes along with their related child contacts (direct reports).

    Note: Ensure the N:N relationship is properly configured and populated. If no results appear, verify the associations using Advanced Find or relationship mappings.
     

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

News and Announcements

Season of Giving Solutions is Here!

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 > Customer experience | Sales, Customer Insights, CRM

#1
Pallavi Phade Profile Picture

Pallavi Phade 101

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 72 Super User 2025 Season 2

#3
TAHER Mehdi Profile Picture

TAHER Mehdi 58

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans