Forum Discussion
Get data - Json.document
- 5 months ago
Hi Olufemi7 & v-sshirivolu
Thank you very much for your quick response to my request.
Yesterday we finaly succeded in getting the query correct and the I now get the expected data in my datamodel - thank you very much for your input and support.
Hi HCJ2026,
Your current API request is set to fetch page 1 with a fixed pageSize of 29,999 records. Most modern APIs, including AutoPilot, use pagination, so each request only returns a single page of data even if more pages are available. This is why you only receive the first page. To get all records, you’ll need to add pagination logic and request each page in order, then combine the results. In Power Query (M language), this usually involves creating a function to retrieve one page and then using List.Generate or similar logic to loop through page numbers until no more data is returned.
After collecting all pages, you can combine them into one table. Json.Document itself does not require any changes, rather, you need to add pagination logic so Power Query makes multiple API calls. This way, your query will return all timeregistrations, not just the first page.
Refer these Microsoft Docs -
https://learn.microsoft.com/en-us/powerquery-m/web-contents
https://learn.microsoft.com/en-us/power-query/samples/trippin/5-paging/readme
https://learn.microsoft.com/en-us/power-query/handling-paging
Thank you.