Pagination: Repeaters

In continuation to my previous challenges with Google sheets, I wanted to share another epiphany in hope that it may help someone else having similar challenges - this time with pagination.

Thanks to @Msquare_Automation for the hints here, but I had a battle implementing in my scenario… So here was my solution (which please feel free to comment/critique).

The logic

  1. First http request so that I can pass the details of the number of records and how many records per page
  2. Repeater number of records and how many records per page to get to the number of repeats needed i.e. {{ceil(49.data.page_summary.total / 49.data.page_summary.page_size)}}
  3. Second http request updated with a query string of page_number which references the count of the repeat.

The rest of the scenario, which still has a lot to be fleshed out but should eventually separate and summarise the data into a sheet per date range and SKU but felt that this pagination “logic” may help someone and perhaps someone could improve on my logic.

Happy making!

2 Likes

This will work fine so long as you know how many records you need to repeat over. If you’re dealing with an API that does not have a way of getting that information ahead of time, then you’re SOL.

I’m dealing with the Shopify GraphQL API at the moment and, like many other APIs, they only provide the idea of “has next page”.

If you were writing this in any actual code - it’d be easy, just continue repeating until there are no further pages. But as-is Make only allows you to repeat over a specific static number, so… :man_facepalming:

Hi there, i’m trying to do the samething as you but i’m having difficultly, would you mind sharing your configuration ? that would be a lot of help thanks you