Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I realize that this question has been posted a thousand times, but I just couldn't find an answer to my specific case nonetheless.
So I'm querying a REST API, which returns paged results. I thus need to iterate in this way: based on the size of the last page (which is a field in the JSON response), increment a REST query parameter to get the next page, until the next page contains no records. In pseudo-code:
content ← True
i ← 1
While content
response ← get(url, http_parameters=['start' = i])
results ← results + response['records']
i ← i + response['size']
content ← size(response['records']) > 0
Endwhile
Can anyone explain how this can be realized in Power Query? I understand that there's a Table.GenerateByPage function, but Microsoft's documentation isn't great when learning from scratch.
Base code for the time being:
let
rooturl = "https://my.apiservice.com/",
Source =
Web.Contents(
rooturl,
[
Headers = [
#"Content-Type" = "application/json"
],
RelativePath = "api/rest/endpoint"
]
)
in
Source
Any hint to the right track will be much appreciated! Thanks in advance!
Hi @mrgou ,
Maybe you can try to do like this.
Or try this.
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
6 | |
6 | |
3 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
3 |