Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

SuccessFactors API future hire import

janB
New Contributor II
New Contributor II

Hello All, 

We currently import future hires manually with the following URL : 

"connection": "userAuth",
"url": "https://XXXX.successfactors.eu/odata/v2/User/?$expand=empInfo/jobInfoNav/divisionNav,empInfo/jobInfoNav,hr,manager/personKeyNav,empInfo/personNav/phoneNav/phoneTypeNav,empInfo/jobInfoNav/companyNav,empInfo/jobInfoNav/departmentNav,empInfo/jobInfoNav/companyNav/countryOfRegistrationNav,empInfo/jobInfoNav/locationNav/addressNavDEFLT,empInfo/jobInfoNav/employeeClassNav,empInfo/jobInfoNav/employeeClassNav/picklistLabels,empInfo/jobInfoNav/customString8Nav&$select=empId,firstName,lastName,nickname,email,state,hr/username,empInfo/startDate,empInfo/lastDateWorked,empInfo/jobInfoNav/jobTitle,empInfo/jobInfoNav/company,empInfo/jobInfoNav/department,empInfo/jobInfoNav/departmentNav/name_en_US,empInfo/jobInfoNav/location,empInfo/jobInfoNav/costCenter,empInfo/jobInfoNav/businessUnit,empInfo/jobInfoNav/division,empInfo/jobInfoNav/customString8,empInfo/jobInfoNav/companyNav/countryOfRegistrationNav/externalName_en_US,empInfo/jobInfoNav/companyNav/name,empInfo/jobInfoNav/locationNav/addressNavDEFLT/city,empInfo/jobInfoNav/locationNav/addressNavDEFLT/zipCode,empInfo/jobInfoNav/locationNav/addressNavDEFLT/state,empInfo/jobInfoNav/companyNav/countryOfRegistrationNav/twoCharCountryCode,status,cellPhone,businessPhone,manager/personKeyNav/personIdExternal,custom12,custom11,empInfo/jobInfoNav/employeeClassNav/externalCode,empInfo/jobInfoNav/locationNav/addressNavDEFLT/address1,empInfo/jobInfoNav/locationNav/addressNavDEFLT/address2,empInfo/jobInfoNav/locationNav/addressNavDEFLT/address3,empInfo/jobInfoNav/locationNav/addressNavDEFLT/address4,empInfo/jobInfoNav/employeeClassNav/picklistLabels/label,empInfo/jobInfoNav/employeeClassNav/localeLabel,empInfo/jobInfoNav/customString8Nav/name_defaultValue,empInfo/personNav/phoneNav/phoneNumber,empInfo/jobInfoNav/locationNav/name,empInfo/jobInfoNav/divisionNav/name,username&$filter=username+eq+'XXXXXX'+or+username+eq+'XXXXXX'+and+status+in+'f','F','t','T'&fromDate=1900-01-01&toDate=9999-12-31 ",

 

We would like to change the filter to contain following : 

status  eq 'f' and empInfo/startDate ge 'CurentDate'&$asOfDate=9999-12-31

Testing following filter in postman is working fine : 

&$filter=status  eq 'f' and empInfo/startDate ge '2024-09-12'&$asOfDate=9999-12-31

 

We are failing to add the filter. Always getting Error Message-null

Tested filters: 

&$filter=status+eq+'f'+and+empInfo/startDate+eq+'2024-09-12'&$asOfDate=9999-12-31",

&$filter=status+eq+'f'+and+empInfo/startDate+gt+datetimeoffset'${Calendar aa=Calendar.getInstance();aa.getTime().format(\"yyyy-MM-dd\")}'&$asOfDate=9999-12-31",

&$filter=empInfo/startDate+gt+datetimeoffset'${Calendar aa=Calendar.getInstance();aa.getTime().format(\"yyyy-MM-dd\")}'+status+eq+'f'&$asOfDate=9999-12-31",

 

$asOfDate is required as discussed with HR. 

 

Thanks 

[This message has been edited by moderator to disable text hyperlinks]

3 REPLIES 3

rushikeshvartak
All-Star
All-Star
"https://XXXX.successfactors.eu/odata/v2/User/?$expand=empInfo/jobInfoNav/divisionNav,empInfo/jobInfoNav,hr,manager/personKeyNav,empInfo/personNav/phoneNav/phoneTypeNav,empInfo/jobInfoNav/companyNav,empInfo/jobInfoNav/departmentNav,empInfo/jobInfoNav/companyNav/countryOfRegistrationNav,empInfo/jobInfoNav/locationNav/addressNavDEFLT,empInfo/jobInfoNav/employeeClassNav,empInfo/jobInfoNav/employeeClassNav/picklistLabels,empInfo/jobInfoNav/customString8Nav&$select=empId,firstName,lastName,nickname,email,state,hr/username,empInfo/startDate,empInfo/lastDateWorked,empInfo/jobInfoNav/jobTitle,empInfo/jobInfoNav/company,empInfo/jobInfoNav/department,empInfo/jobInfoNav/departmentNav/name_en_US,empInfo/jobInfoNav/location,empInfo/jobInfoNav/costCenter,empInfo/jobInfoNav/businessUnit,empInfo/jobInfoNav/division,empInfo/jobInfoNav/customString8,empInfo/jobInfoNav/companyNav/countryOfRegistrationNav/externalName_en_US,empInfo/jobInfoNav/companyNav/name,empInfo/jobInfoNav/locationNav/addressNavDEFLT/city,empInfo/jobInfoNav/locationNav/addressNavDEFLT/zipCode,empInfo/jobInfoNav/locationNav/addressNavDEFLT/state,empInfo/jobInfoNav/companyNav/countryOfRegistrationNav/twoCharCountryCode,status,cellPhone,businessPhone,manager/personKeyNav/personIdExternal,custom12,custom11,empInfo/jobInfoNav/employeeClassNav/externalCode,empInfo/jobInfoNav/locationNav/addressNavDEFLT/address1,empInfo/jobInfoNav/locationNav/addressNavDEFLT/address2,empInfo/jobInfoNav/locationNav/addressNavDEFLT/address3,empInfo/jobInfoNav/locationNav/addressNavDEFLT/address4,empInfo/jobInfoNav/employeeClassNav/picklistLabels/label,empInfo/jobInfoNav/employeeClassNav/localeLabel,empInfo/jobInfoNav/customString8Nav/name_defaultValue,empInfo/personNav/phoneNav/phoneNumber,empInfo/jobInfoNav/locationNav/name,empInfo/jobInfoNav/divisionNav/name,username&$filter=status eq 'f' and empInfo/startDate ge datetime'${Calendar.getInstance().format("yyyy-MM-dd")}'&$asOfDate=9999-12-31"

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

janB
New Contributor II
New Contributor II

Hello , 

Thank you for your suggestion , 

Unfortunately this is not working. I received syntax error - so I updated it to : 

$filter=status+eq+'f'+and+empInfo/startDate+ge+datetime'${Calendar.getInstance().format('yyyy-MM-dd')}'&asOfDate=9999-12-31", 

But still getting NullResponseFromTarget

I'm getting NullResponseFromTarget even with this filter : 

$filter=status+eq+'f'+and+empInfo/startDate+ge+'2024-09-10'&asOfDate=9999-12-31"

Having feeling that the empInfo/startDate is the problematic part ... Thoughts ?

Thanks

1. Check Field Existence & Path:

  • First, confirm that the empInfo/startDate field is available and correctly named in the OData metadata from SuccessFactors. You can inspect the metadata by going to https://<your-SuccessFactors-domain>/odata/v2/$metadata. Look for empInfo and startDate to verify the correct path and ensure that startDate is valid in the empInfo entity.

2. Ensure Correct Date Format:

  • SuccessFactors OData typically expects dates in the YYYY-MM-DDThh:mm:ss format (e.g., 2024-09-10T00:00:00). Try adjusting the format of your startDate filter to:

     
    $filter=status eq 'f' and empInfo/startDate ge datetime'2024-09-10T00:00:00'

3. Use ISO Date Format:

  • Try switching the format to YYYY-MM-DDTHH:MM:SSZ, which is often required by OData:

     
    $filter=status eq 'f' and empInfo/startDate ge datetime'2024-09-10T00:00:00Z'

4. Check for Nullable Fields:

  • If empInfo/startDate can be null or missing for some employees, the query might break. Try adding a condition that handles cases where startDate is null:

     
    $filter=status eq 'f' and empInfo/startDate ne null and empInfo/startDate ge datetime'2024

Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.