and more in a single search tool across platforms. Read the announcement here. |
04/12/2022 01:19 PM
Hi,
I have a requirement where I need to pass some dates in my filter while importing user data from SuccessFactors. I came across an example in the SuccessFactors documentation provided. But these dates are all hardcoded.
Is it possible to pass the dates as dynamic attributes like fromDate=current date? If yes, please let me know the format to do so.
I tried using ${(new Date()).format('yyyy-MM-dd')} but it gives me a responseStatusCode:: null.
Any help would be greatly appreciated.
Solved! Go to Solution.
04/12/2022 02:57 PM
Hi Arushi,
Yes, it is possible to pass the date as a dynamic attribute. Please try with the below sample URL format
Sample URL format: https://<url>?%24format=json&%24filter=status%20in%20%27t%27,%27f%27&fromDate=${(new Date()).format('yyyy-MM-dd')}
Thank you
Vedanth B.K
04/12/2022 02:57 PM
Hi Vedanth,
I tried this but Im getting an error ( it doesnt seem to be replacing the date) :
2022-01-05 13:21:51,655 [quartzScheduler_Worker-2] DEBUG rest.RestProvisioningService - Calling Webservice Url - https://api8.successfactors.com/odata/v2/User('010304')?fromDate=${(new Date()).format('yyyy-MM-dd)}&paging=cursor&$filter=empInfo/jobInfoNav/company%20ne%20%27BEA%27&$expand=empInfo/personNav/personalInfoNav/customString3Nav/picklistLabels,empInfo/personNav/emailNav/emailTypeNav/picklistLabels,empInfo/jobInfoNav/locationNav/addressNavDEFLT,empInfo/jobInfoNav/locationNav/customString5Nav,externalCodeOfcust_EEIntegration_noneffNav,empInfo/jobInfoNav/costCenterNav,empInfo/jobInfoNav/departmentNav,empInfo/jobInfoNav/divisionNav,empInfo/jobInfoNav/employeeClassNav,empInfo/jobInfoNav/employeeTypeNav,empInfo/personNav/employmentNav,empInfo/jobInfoNav/regularTempNav,empInfo/jobInfoNav/emplStatusNav,empInfo/personNav/personEmpTerminationInfoNav,empInfo/jobInfoNav/customString12Nav/picklistLabels,empInfo/jobInfoNav/companyNav,empInfo/personNav/homeAddressNavDEFLT,empInfo/jobInfoNav/eventNav/picklistLabels,empInfo/jobInfoNav/eventReasonNav with httpParams - null
2022-01-05 13:21:51,655 [quartzScheduler_Worker-2] DEBUG services.HttpClientUtilityService - isFipsEnabled = false
2022-01-05 13:21:51,655 [quartzScheduler_Worker-2] DEBUG services.HttpClientUtilityService - getHttpClient - sslParams : null
2022-01-05 13:21:51,655 [quartzScheduler_Worker-2] DEBUG services.HttpClientUtilityService - getHttpClient - proxyParams : null
2022-01-05 13:21:51,655 [quartzScheduler_Worker-2] DEBUG services.HttpClientUtilityService - getHttpClient - sslSocketFactory : null
2022-01-05 13:21:51,659 [quartzScheduler_Worker-2] DEBUG services.HttpClientUtilityService - getHttpClient - HttpClientBuilder.create().build() called.
2022-01-05 13:21:51,659 [quartzScheduler_Worker-2] DEBUG rest.RestUtilService - Got showLogs = true
2022-01-05 13:21:51,660 [quartzScheduler_Worker-2] DEBUG rest.RestProvisioningService - Got Webservice API Response: [error:Error Illegal character in query at index 66: https://api8.successfactors.com/odata/v2/User('010304')?fromDate=${(new Date()).format('yyyy-MM-dd)}&paging=cursor&$filter=empInfo/jobInfoNav/company%20ne%20%27BEA%27&$expand=empInfo/personNav/personalInfoNav/customString3Nav/picklistLabels,empInfo/personNav/emailNav/emailTypeNav/picklistLabels,empInfo/jobInfoNav/locationNav/addressNavDEFLT,empInfo/jobInfoNav/locationNav/customString5Nav,externalCodeOfcust_EEIntegration_noneffNav,empInfo/jobInfoNav/costCenterNav,empInfo/jobInfoNav/departmentNav,empInfo/jobInfoNav/divisionNav,empInfo/jobInfoNav/employeeClassNav,empInfo/jobInfoNav/employeeTypeNav,empInfo/personNav/employmentNav,empInfo/jobInfoNav/regularTempNav,empInfo/jobInfoNav/emplStatusNav,empInfo/personNav/personEmpTerminationInfoNav,empInfo/jobInfoNav/customString12Nav/picklistLabels,empInfo/jobInfoNav/companyNav,empInfo/personNav/homeAddressNavDEFLT,empInfo/jobInfoNav/eventNav/picklistLabels,empInfo/jobInfoNav/eventReasonNav]
2022-01-05 13:21:51,660 [quartzScheduler_Worker-2] DEBUG rest.RestProvisioningService - pullObjectsByRest - responseStatusCode ::null
2022-01-05 13:21:51,660 [quartzScheduler_Worker-2] DEBUG rest.RestUtilService - Got showLogs = true
2022-01-05 13:21:51,660 [quartzScheduler_Worker-2] DEBUG rest.RestProvisioningService - Got null response statusCode with erroMsg - null
2022-01-05 13:21:51,660 [quartzScheduler_Worker-2] ERROR rest.RestProvisioningService - Exception in getting response in pullObjectsByRest :
java.lang.Exception: NullResponseFromTarget
at com.saviynt.provisoning.rest.RestProvisioningService.pullObjectsByRest(RestProvisioningService.groovy:4200)
04/12/2022 02:57 PM
Resolved. Figured it out.
Resolution: If you have a $ in your URL, Saviynt tries to replace that and fails and hence it doesnt replace any ${} code. To fix, replace $ with %24 (URLEncoded value for $ ) . Replace all $ other than the ${new Date....}