# Issues with WS Pagination

**URL:** <https://developer.sailpoint.com/discuss/t/issues-with-ws-pagination/53756>\
**Category:** SHF Discussion and Questions\
**Tags:** webservice-connector, sailpoint-identity-security, aggregation\
**Created:** [April 23, 2024, 10:29pm UTC](https://developer.sailpoint.com/discuss/t/issues-with-ws-pagination/53756 "2024-04-23T22:29:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![joe\_gaileyiii](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@joe\_gaileyiii](https://developer.sailpoint.com/discuss/u/joe_gaileyiii)\
**Post date:** [April 23, 2024, 10:29pm UTC](https://developer.sailpoint.com/discuss/t/issues-with-ws-pagination/53756/1 "2024-04-23T22:29:17Z")

</div>

Hello all,

I have a new integration that has paginated results, but unfortunately no total count or next page attribute, or anything to indicate there are more results. I have created the following logic to try to brute force the aggregation to approach the total number of records, but it always returns 275.

TERMINATE\_IF $RECORDS\_COUNT$ == 13600  
$newOffset$ = $offset$ + 100  
$endpoint.fullUrl$ = $application.baseUrl$ + “/rest/api/2/users?maxResults=100&startAt=” + $newOffset$

I would like to leverage NO\_RECORDS == TRUE, but I cannot get the aggregation above this number even with this hard coded example. Any ideas?

---

<div class="post-metadata">

**Author:** ![Arshad](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@Arshad](https://developer.sailpoint.com/discuss/u/Arshad)\
**Post date:** [April 24, 2024, 3:11am UTC](https://developer.sailpoint.com/discuss/t/issues-with-ws-pagination/53756/2 "2024-04-24T03:11:34Z")

</div>

> [@joe\_gaileyiii](#):
>
> maxResults=100&startAt

@joe_gaileyiii, Does you API endpoint support querying based on “`maxResults`” or “`startAt`” parameters? Because if it doesn’t, I don’t see a reason why this would work. Ideally, the target system needs to allow querying on the API endpoint based on query params like ‘count’, ‘nextpage’, ‘index’, ‘maxresults’ etc for it to be configured on ISC pagination config.

---

<div class="post-metadata">

**Author:** ![cgurung](https://avatars.discourse-cdn.com/v4/letter/c/779978/32.png) [@cgurung](https://developer.sailpoint.com/discuss/u/cgurung)\
**Post date:** [April 24, 2024, 4:31am UTC](https://developer.sailpoint.com/discuss/t/issues-with-ws-pagination/53756/3 "2024-04-24T04:31:44Z")

</div>

You could try this  
$sysparm\_limit$ = 100  
TERMINATE\_IF $RECORDS\_COUNT$ \< $sysparm\_limit$  
$newOffset$ = $newOffset$ + $sysparm\_limit$  
$endpoint.fullUrl$ = $application.baseUrl$ + “/rest/api/2/users?maxResults=100&startAt=” + $newOffset$

here is reference for pagination - [Paging Based on Limit-Offset](https://documentation.sailpoint.com/connectors/webservices/help/integrating_webservices/paging_based_on_limit-offset.html)

If pagination tab is not working for you, then other way to deal this is using before and after operation rule if it is VA based webservice connector - [Before and After Operation Rules Configuration](https://documentation.sailpoint.com/connectors/webservices/help/integrating_webservices/paging_before-after.html)

---

<div class="post-metadata">

**Author:** ![schattopadhy](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/schattopadhy/32/8854_2.png) [@schattopadhy](https://developer.sailpoint.com/discuss/u/schattopadhy)\
**Post date:** [April 24, 2024, 6:53am UTC](https://developer.sailpoint.com/discuss/t/issues-with-ws-pagination/53756/4 "2024-04-24T06:53:15Z")

</div>

@joe_gaileyiii  
you can try below logic:

“TERMINATE\_IF $response.$Resources[\*].id$ == NULL  
$startIndex$ = $response.startIndex$ + $response.itemsPerPage$  
$endpoint.fullUrl$ = "$application.baseUrl$ + “/rest/api/2/users?maxResults=100&startAt=” + $startIndex$",

---

<div class="post-metadata">

**Author:** ![iamnithesh](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/iamnithesh/32/42445_2.png) [@iamnithesh](https://developer.sailpoint.com/discuss/u/iamnithesh)\
**Post date:** [April 24, 2024, 5:47pm UTC](https://developer.sailpoint.com/discuss/t/issues-with-ws-pagination/53756/5 "2024-04-24T17:47:07Z")

</div>

> [@joe\_gaileyiii](#):
>
> $newOffset$ = $offset$ + 100

change this to  
`$newOffset$ = $startAt$ + 100`  
and try

If my memory serves right, you need to refer to the query parameter from previous page context URL. You are using `$offset$`, but there is no such parameter in the URL

---

<div class="post-metadata">

**Author:** ![joe\_gaileyiii](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@joe\_gaileyiii](https://developer.sailpoint.com/discuss/u/joe_gaileyiii)\
**Post date:** [April 25, 2024, 4:36pm UTC](https://developer.sailpoint.com/discuss/t/issues-with-ws-pagination/53756/6 "2024-04-25T16:36:17Z")

</div>

This worked for me, thank you!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [June 24, 2024, 4:36pm UTC](https://developer.sailpoint.com/discuss/t/issues-with-ws-pagination/53756/7 "2024-06-24T16:36:30Z")

</div>

Closed on June 24, 2024, 4:36pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
