This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Have you ever used Paginated APIs in Power Query to import data? If you have, I have a challenge for you. One of my friends asked me this question, but I couldn’t help him. So, I’m reaching out to my network to find the answer.
He wants to add all the tasks based on each list id (lists.id). So, we need to send each list.id to the API to get the tasks.
#"Added Custom Task" = Table.AddColumn(#"Removed Other Columns4" , "Custom", each Json.Document(Web.Contents("https://lnkd.in/gGDzdEbX"&[lists.id]&"/task?archived=false",[Headers=headers,Query = [archived = "false"]]))),
#"Expanded Custom4" = Table.ExpandRecordColumn(#"Added Custom Task", "Custom", {"tasks", "last_page"}, {"tasks", "last_page"}),
However, some of the lists, like the first row, may have more than 100 tasks. So, their last_page value is FALSE.
He needs to add another row with the same data, but for the second, third... page for each list that has more than 100 tasks.
We tried a nested loop by using List.generate, but no luck.
Our other friend ChatGPT was not able to help either.
So I’m hoping my human network can help me with the answer
There are plenty of examples on the interwabs for paging through API resposes either via "next page" links or with offset. You can decide between List.Generate and List.Accumulate, depending on the expected amount of data (but also keeping in mind that the browser cache will help).
As you can probably appreciate it is nearly impossible to help with API queries without access to said API (which you may not be willing to provide for understandable reasons)
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.