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).
First http request so that I can pass the details of the number of records and how many records per page
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)}}
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.
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…
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
It’s been awhile so can’t recall if this was my final solution, or what scenario it was on or anything. But I think this is in relation to what I was originally trying to tackle.
In short, when you pull from Shopify graph it will have an attribute of ‘hasnextpage’ or something, so:
I initialize all my variables
I start a repeater for the max amount i want to iterate over
get the data
if there’s still another page, i change the variable. if there’s none, i set it as complete and it will break out next time