cancel
Showing results for 
Search instead for 
Did you mean: 

Fetch employee manager name and email from Successfactors EC

0 Kudos

Hello Experts,

I am working on a CPI iFlow wherein i use SF EC CompoundEmployee API to fetch personal, address and job info about employees belonging to specific countries and job codes, to send them to a 3rd-party in the form of a file.

In addition to the details mentioned above, there is a requirement to fetch the employees' Manager's first name, last name and email address.

I understand that I can get the manager_id/manager_id_external from the employee job info entity and pass them to the PerPersonal Odata API can be used to fetch the names and email addresses. However, this is requiring multiple calls to SF EC and doesn't seem to be the most efficient way to handle this.

Please suggest a better way, if there is any.

Thanks,

Diptee

Accepted Solutions (0)

Answers (1)

Answers (1)

nzhome
Discoverer
0 Kudos

Yes I was looking for the same solution. Couldn't find anything in the Odata API ref. but this seems to work: and its only 3 calls for everything possible, its worth it, compared to compound api.

EmpJob Select managerUserNav/email

$expand=managerUserNav


<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/managerUserNav" type="application/atom+xml;type=entry" title="managerUserNav"

href="EmpJob(seqNumber=1L,startDate=datetime'2019-08-01T00:00:00',userId='10589')/managerUserNav"> <m:inline>

<entry>

<id>https://api10preview.sapsf.com:443/odata/v2/User('10518')</id> <title type="text"></title>
<updated>2020-09-20T08:49:01Z</updated>
<author> <name></name> </author>
<link rel="edit" title="User" href ="User('10518')"></link>
<category term="SFOData.User" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"></category>
<content type="application/xml"> <m:properties> <d:empId>10518</d:empId>
<d:firstName>test</d:firstName>
<d:lastName>test</d:lastName>
<d:hireDate m:type="Edm.DateTime">2019-08-01T00:00:00</d:hireDate>
<d:email>test @ test.com</d:email> <<<===== MANAGERS EMAIL
</m:properties>
</content>
</entry>
</m:inline>
</link>


{{sfurl}} in Postman = "https://api10preview.sapsf.com:443/odata/v2/"

{{sfurl}}EmpJob?$select=startDate,standardHours,costCenter,userId,lastModifiedDateTime,businessUnit,division,department,location,businessUnitNav/name,divisionNav/name,departmentNav/name,locationNav/name,locationNav/addressNavDEFLT/country,positionNav/externalName_defaultValue,positionNav/description,companyNav/externalCode,companyNav/name,positionNav/parentPosition/code,positionNav/employeeClassNav/externalCode,employmentTypeNav/externalCode,positionNav/code,positionNav/positionTitle,positionNav/changeReason,workscheduleCodeNav/averageHoursPerDay,costCenterNav/name,employeeClassNav/externalCode,managerUserNav/empId,managerUserNav/firstName,managerUserNav/lastName,managerUserNav/hireDate,managerUserNav/email,employeeClassNav/picklistLabels/label,emplStatusNav/externalCode,employmentNav/isContingentWorker,employmentNav/lastDateWorked,isFulltimeEmployee,employmentNav/endDate,countryOfCompany&$expand=positionNav/employeeClassNav,employmentTypeNav,positionNav,companyNav,businessUnitNav,divisionNav,departmentNav,locationNav,employmentNav,workscheduleCodeNav,costCenterNav,positionNav/parentPosition,employeeClassNav,managerUserNav,emplStatusNav,employeeClassNav/picklistLabels&$orderby=lastModifiedDateTime

{{sfurl}}PerPerson?$select=personIdExternal,lastModifiedDateTime,dateOfBirth,employmentNav/userId,employmentNav/originalStartDate,employmentNav/endDate,nationalIdNav/nationalId,nationalIdNav/cardType,emailNav/emailAddress,emailNav/emailType,phoneNav/phoneNumber,phoneNav/phoneType,phoneNav/phoneTypeNav/externalCode,emailNav/emailTypeNav/externalCode,employmentNav/lastModifiedDateTime,phoneNav/lastModifiedDateTime&$expand=nationalIdNav,employmentNav,emailNav,phoneNav,phoneNav/phoneTypeNav,emailNav/emailTypeNav&fromDate=${property.fromdatevalue}&toDate=9999-12-31&$orderby=lastModifiedDateTime


{{sfurl}}PerPersonal?$select=personNav/employmentNav/userId,personNav/employmentNav/userNav/totalTeamSize,preferredName,personIdExternal,startDate,lastName,middleName,firstName,lastModifiedDateTime,gender,salutationNav&$expand=personNav/employmentNav,personNav,salutationNav,personNav/employmentNav/userNav&fromDate=$2020-09-20&toDate=9999-12-31&$orderby=lastModifiedDateTime