Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
Check it out now!Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
Hello,
We are new to powerbi. We managed to query an API and we got the data back.
On the other hand, there is a limitation on the data in response: we are limited to 100 lines.
I think this is a common issue, however we haven't found on the forum how to create a function that would retrieve ALL data.
We have seen that the API returns us a hasnext set to TRUE when other results are present but not returned. In addition, the API offers the possibility to skip the n first line. How to exploit this please? Is it about making a loop?
But do you have an example for powerbi? thank you
Here our request:
let
auth_key ="Token XXX",
base_url = "https://url_of_our_api/",
extension = "api/v1/alerts/",
url = base_url &extension,
header= [#"Authorization" = auth_key,
#"Content-Type" = "application/json"],
content1= "{
""filters"": {
""alertOpen"":{
""eq"": true
},
""severity"": {
""eq"": [0,1]
}
},
""skip"": 100, // skip n first lines
""limit"": 100 //by default
}",
webdata1 = Web.Contents(url, [Headers=[#"Authorization" = auth_key,
#"Content-Type" = "application/json"],Content = Text.ToBinary(content1)]),
response1 = Json.Document(webdata1),
data = response1[data]
in
data
Here our result :
Thank a lot !
You can use List.Generate() function to create a loop.