Having issues getting pagination working?

Hi,

I have been working on integrating pagination into my workflow but I running into an error where the “Pagination Complete When: Other” option is not behaving as expected.

The API I am call uses a query parameter of “start” and increments in of 200. There are roughly 600 items that need to be queried so the pagination call needs to run for a minimum of 4 times to ensure all the items are gathered.

I would like the start parameter to increase by 200 on each call until a value of {{ $response.body[‘active-users’][‘total-returned-record-number’] == 0 }} gets returned.

However when I run the call I get the following error:

However when I increase the increment to a value (800 for example) that will return a result that will match the Complete expression it matches as true

I don’t think the increment expression I have set is working as intended, does anyone know what I am doing wrong.

Hey @cmcbride781 hope all is well.

You pagination uses a variable startCount, which is not something I am aware of.
What you are looking for is probably {{ $pageCount*200 }}, this will make it start at 0 and increment by 200.

And the condition to stop pagination is
{{ $response.body["active-users"]["total-returned-record-number"] == 0 }}

Here is an example, as you can see I removed the manual limit and it only takes 3 attempts, since that third page returns 0 for record number:

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