We’re following the documentation, however struggling to see any guidance on how to set up paging to iterate through the dataset until no further records: Aggregation Paging
Does anyone have any advice as to what paging steps we need to include?
Weird that the case you gave for pagination worked for 2k accounts. I think it should have ran until the aggregation times out as the $pageIndex$ variable is set to 0 everytime it runs.
Having said that, you can give the following pagination logic a try.
The Termination logic is not hard coded, so it can handle even more accounts if added in the future.
The pageIndex is auto calculated based on the response from the request. That way we don’t have to worry about the data stored in the variable during the last iteration. Whatever current page is, we want the next page of that as long as there’s data.
Hey @zeel_sinojia , thank you! It has almost worked!
Good news is, this does seem to read all of the accounts, bad news is - it gets stuck aggregating and doesn’t seem to terminate. Any ideas on where we’re going wrong?
Have also tried these attempts, sadly no success. All read the accounts, but fail to terminate the aggregation: