Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/16/2024 02:47 AM - last edited on 09/16/2024 02:52 AM by Sunil
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]
09/16/2024 07:54 AM
"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"
09/17/2024 01:12 AM
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
09/17/2024 11:14 AM
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:
Try switching the format to YYYY-MM-DDTHH:MM:SSZ, which is often required by OData:
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: