How to aggregate the results of unknown number of requests (pagination)?

I want to get some items via an API and do some filters and output the processed items. But the API returns 100 items every time and includes a field “nextLink” if there are more items.

I don’t know exactly how many times that I would call the API, so I tried to use “if block” instead of “repeat block” to do the loop, if the “variable block” can not be updated, then it can not be used for temporarily storing data, and seems “collect block” shoud be used together with looping blocks.

How can I aggregate the items returned by unknown number of requests?

Hi @joezhangmsn

Try this strategy:

you’ll append the values each iteration so that it accumulates the final list which will output through the default port when nextLink is null. I don’t have your API to test the exact values but it should work as a template.

Let me know if this works for you :slight_smile: