Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Simon_Evans
Helper I
Helper I

Not able to refresh a dataset due to dynamic queries

Hi Everyone

 

I have a lovely set of reports in Desktop all nicely pulling data from a third party API. The below code works perfectly and handles the pagination of the JSON.

 

let
Students = List.Generate( () =>
[URL = "https://api.customersite.com/v1.0/schools/AXXXXXXXXXXX/students?extra_ids=true&include=year,registra...",

Result = Json.Document(Web.Contents((URL), [Headers=[Authorization="Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"]]))],
each [URL] <> null,
each [
URL = [Result][meta][pagination][next],
Result = Json.Document(Web.Contents((URL), [Headers=[Authorization="Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"]]))
]

)

 

But when it comes to the Power BI service I can't do any refreshing due to the dynamic building of the URL. I understand using the Relative Path and Query for WebContents but I cannot see how I can alter my code above to handle the pagination of the JSON object when the number of pages is not known.

 

Can anyone give me some guidance on how I can achieve this please so I can setup a refresh schedule for the datasets in the Power BI Service?

1 ACCEPTED SOLUTION
Anonymous
Not applicable
1 REPLY 1
Anonymous
Not applicable

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.