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 :
Finance | Project Operations, Human Resources, ...
Unanswered

OData query get Worker their position and their manager in one query

(0) ShareShare
ReportReport
Posted on by 75

Hi,

I'm trying to get worker information, their position and their manager however I'm having difficulties in getting the manager data in the same query and wonder if there is good way in achieving it in one single query?

As of now I have 2 queries where I can merge the information in the background but would like to achieve it in 1 query. Here us what I have so far:

Get worker and their position (simplified where I have removed the select statement): 

/data/Workers?$expand=EmployeesV2,ContractorsV2,PositionsV2&$filter=ObjectId ne 00000000-0000-0000-0000-000000000000 and WorkerStatus ne Microsoft.Dynamics.DataEntities.HcmWorkerStatus'Terminated'

Get workers and their manager:

/data/EssWorkerManagerRelations?$expand=Manager($select=AadUserPrincipalName,AadUserObjectId,Name),Worker($select=AadUserPrincipalName,AadUserObjectId,Name)

Thanks in advance.

I have the same question (0)
  • huijij Profile Picture
    19,811 on at

    Hi Adam,

    The OData.org reference services contain a few clear examples of expand URI syntax.

    www.odata.org/.../

    If you want to merge queries, you have to make sure that the entities are related.

  • Adam A Profile Picture
    75 on at

    Ended up in using 2 queries and handle data management in the background. Don't seem to be a way solving this.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 522 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans