and more in a single search tool across platforms. Read the announcement here. |
05/23/2022 05:17 AM
For the Rest connector, how do I configure the Offset Pagination totalCountPath attribute for the example response (see below) where the response contains the total number of records in the attribute "@odata.count". Next Page URLs are not available for this endpoint, so have to use Offset based pagination.
From testing various permutations, the Java Script capability does not seem to be enabled for the totalCountPath config attribute, so doing ${response.completeResponseMap.get('@odata.count')} does not function as the log indicates total count = null.
For example:
Solved! Go to Solution.
05/23/2022 05:43 AM
Hello,
The REST connector guide has a few examples on similar use cases on Offset Pagination. You can check them out here:
https://saviynt.freshdesk.com/support/solutions/articles/43000521736-rest-connector-guide
05/23/2022 06:03 AM
The guide does not provide an example of how to retrieve the value for an attribute such as "@odata.count".
05/23/2022 06:37 AM
Hi Paul,
Can you try :
"totalCountPath": "${completeResponseMap.get('@odata.count')}"
05/23/2022 07:00 AM
Thanx for the reply. I'll log a support call.
I've configured as such:
"pagination": {
"offset": {
"offsetParam": "$skip",
"batchParam": "$top",
"batchSize": 10,
"totalCountPath": "${completeResponseMap.get('@odata.count')}"
}
}
Running the account job and monitoring the logs shows that the first 10 records are retrieved but the log also shows "DEBUG rest.RestUtilService - totalCount: null". And the paging stops and does not continue.
If I hard code a value such as 20 in the pagination config the logs show
DEBUG rest.RestUtilService - totalCount: 20
DEBUG rest.RestUtilService - offset: 20
Pagination continues to the second batch of 10 accounts.
05/23/2022 07:41 AM
Hello,
Try a couple of the following combinations as well :
"totalCountPath": "completeResponseMap.get('@odata.count')",
"totalCountPath": "completeResponseMap.@odata.count",
05/23/2022 11:27 PM
Thank you for the suggestions.
I've tried those combinations and they all result in "DEBUG rest.RestUtilService - totalCount: null".
05/24/2022 08:55 PM - edited 05/24/2022 08:55 PM
Hi Paul,
I think the following piece of information will be useful to you.
Cause: This error might occur if the field name is specified with a dot(.).
Resolution: To resolve this issue, specify the field name with the separator ~dot#. For example, replace odata.error with odata~dot#error.
Could you try this out and check if this resolves your issue?
05/24/2022 11:14 PM
Rajesh,
Thank you very much.
The following pagination config works:
"pagination": {
"offset": {
"offsetParam": "$skip",
"batchParam": "$top",
"batchSize": 10000,
"totalCountPath": "completeResponseMap.@odata~dot#count"
}
}
For the D365 F&O connector (REST_Dynamics365(REST)), I've replaced the default pagination configs in the ImportAccountEntJSON config setting with the above, as well as appended "?%24count=true" to all the "url" config attributes. The default totalCountPath attribute value is set to 999999999 for all calls.