Forum Discussion
I do know the total count as it comes back from each request. I've tried setting the has next to 'true' and then the total pages to fetch = &entity.total_count, but it complains that 'entity' is undefined for some reason. What am I missing?
your total pages to fetch will only be able to use input parameters, unfortunately not the data from the response. You won't be able to use the $entity
within that, so you'll have to use the has next to determine if you've reached the end, you could do something like $entity.data.length >= 100 && (100 * (snap.out.totalCount + 1) <= $entity.total_count)
in order to check for both 1) you've got all of the data expected in this response and 2) you haven't reached the limit of data.
- terrible_towel2 years agoNew Contributor II
It seems like this approach does allow me to reach next page, but instead of fetching the rest of the dataset, it just re-fetches the same data from the 1st fetch. So it looks like the Has next expression is working, meaning it evaluates to true, but isn't able to pull the rest of the data. It seems like I'm failing at notifying the API that I want the 2nd batch onwards. So if I start with offset=0, then I'm not able to increment that value.
- ddellsperger2 years agoAdmin
These settings should do it, as long as you set the offset to 0 in the "query parameters" section, you should be in the clear
- terrible_towel2 years agoNew Contributor II
I've changed the '100' to '1k', since that's the API batch size, and it worked like a charm, thank you ddellsperger !
I still have some questions if I may, since I'm not too familiar with the 'snap.out' property. I tend to fail at trying to read the values of this property during validation and see what it holds to get a better understanding, is that impossible? Another thing is the $entity property being accessible in the 'Has Next' clause but not in the others, can you elaborate on that please?