Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/07/2024 10:58 AM - edited 08/07/2024 11:02 AM
Hi folks,
We are trying to import users from another subsidiary's Saviynt instance (tenant2) into the main company's Saviynt (tenant1).
The first page comes in without any issues but paging won't kick in as expected.
Various paging methods have been attempted:
"pagination": {
"offset": {
"offsetParam": "offset",
"batchParam": "max",
"batchSize": 50,
"totalCountPath": "9999999"
}
}
This one reads one page and quits successfully.
"pagination": {
"nextUrl": {
"nextUrlPath": "${response?.completeResponseMap?.count<50?null:'https://tenant2.saviyntcloud.com/ECM/api/v5/user?sort=userkey&q=[some filter]&fields=[list of fields]&max=50&offset='+Math.addExact(parseInt(response.completeResponseMap.offset),response.completeResponseMap.count)}"
}
}
This one reads one page and aborts with message: "[error:Error Illegal character in path at index 1:" as it was not able to compute nextUrlPath.
I also tried "Math.addExact(response.completeResponseMap.offset,response.completeResponseMap.count)" and got the same error. I figured since offset is a string in the response map, this could be the issue but apparently not...
Sample response payload:
{
"msg": "Successful",
"offset": "0",
"count": 50,
"errorCode": "0",
"sort": "userkey",
"results": [
{
[users 1...50]
}
}
Any help would be greatly appreciated!
Solved! Go to Solution.
08/07/2024 06:14 PM
"pagination": {
"nextUrl": {
"nextUrlPath": "${response?.completeResponseMap?.count < 50 ? null : 'https://tenant2.saviyntcloud.com/ECM/api/v5/user?sort=userkey&q=[some filter]&fields=[list of fields]&max=50&offset=' + (parseInt(response.completeResponseMap.offset) + response.completeResponseMap.count)}"
}
}
08/07/2024 07:01 PM - edited 08/07/2024 07:17 PM
Same error again... I have no idea where I am messing this up...
"2024-08-08T02:14:22.337+00:00","ecm-worker","rest.RestProvisioningService","quartzScheduler_Worker-10-dcnbg","DEBUG","Got Webservice API Response: [error:Error Illegal character in path at index 1: ${response?.completeResponseMap?.count < 50 ? null : 'https://[tenant].saviyntcloud.com/ECM/api/v5/user?sort=userkey&q=[query]:IC&fields=[fields]=******&max=50&offset=' + (parseInt(response.completeResponseMap.offset),response.completeResponseMap.count)}]"
08/07/2024 08:10 PM
Solution found. parseInt was not enough, it needed the Integer prefix
"pagination": {
"nextUrl": {
"nextUrlPath": "${response?.completeResponseMap?.count<50?null:'https://[tenant].saviyntcloud.com/ECM/api/v5/user?sort=userkey&q=[query]&fields=[list of fields]&max=50&offset='+Math.addExact(Integer.parseInt(response.completeResponseMap.offset),50)}"
}
}