Calling Query Trigger recursively

I have an API request that returns this structure

class_id: ""
records: [obj]
continuationToken: ""

continuationToken will be only returned if there are more records(each call is a 1000 records)

What I need is to get all records.

here is the API call query


note pageSize is capped at a 1000

This is what I am at right now which will return 2000 records

I tried doing recursively calling the function but it did not work.

Any ideas to make this work with recursion

Hey @FatahChan

Is it returning any results currently? If you check the browser console, does it seem like the right data is being passed to leaderboard_volume?

In the meantime, we have a fairly similar example here: http://community.retool.com/t/how-to-run-a-rest-api-query-for-each-item-in-an-array-and-return-all-results-together/2352

Hi Tess,

Yes, it does return an array with length <= 2000

As I am calling the leaderboard.volume twice if the first time returns a continuationToken.

What I need is to call it recursively, another continuationToken on the second call and so on.

The data that is being passed on to leaderboard.volume currently is correct.

Was able to resolve my issue without recursion