Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/11/2024 08:53 PM
Hi,
Is there a way to calculate a date based on (currentdate - X days) as per below for our HR feed connection and ImportuserJSON section.
"url": "https://<url>?terminated_from_date=(currentdate - 120)&limit=50&page=1",
Returned calculation should be yyyy-MM-dd.
Tried below but failed.
"url": "https://<url>?terminated_from_date=${Calendar.getInstance().(getTimeInMillis()-(120*86400000)).format('yyyy-MM-dd')}&limit=50&page=1"
thanks
Solved! Go to Solution.
08/11/2024 09:21 PM - edited 08/11/2024 10:05 PM
"url": "https://<url>?terminated_from_date=${Calendar.getInstance().with { it.add(Calendar.DAY_OF_YEAR, -120); it.time }.format('yyyy-MM-dd')}&limit=50&page=1"
08/12/2024 04:21 AM
Hi Rushikesh,
What am I doing wrong with this code, doesn't like $ sign. thanks
"nextUrl": {
"nextUrlPath": "${response?.objectList?.size()>0?'https://<url>?limit=50&page=' + Math.addExact(response.completeResponseMap.pagination.current_page,1) + '&terminated_from_date=${Calendar.getInstance().with { it.add(Calendar.DAY_OF_YEAR, -120); it.time}.format('yyyy-MM-dd')}':null}"
08/12/2024 04:23 AM
"nextUrl": {
"nextUrlPath": "${response?.objectList?.size()>0?'https://<url>?limit=50&page=' + Math.addExact(response.completeResponseMap.pagination.current_page,1) + '&terminated_from_date=' + Calendar.getInstance().with { it.add(Calendar.DAY_OF_YEAR, -120); it.time }.format('yyyy-MM-dd') : null}"
}
08/12/2024 02:10 PM
Legend, I tried many combinations here didn't realise you don't need the ${} sign for the calendar method.
08/12/2024 02:13 PM
Just to reconfirm . Above pagination is working issue was since $ was define outside in starting again its not needed for anything which is dynamic.
08/11/2024 09:50 PM
That first option works great, thanks for that