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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
IvanS
Helper V
Helper V

Scheduled refresh for Dynamic data sources - JSON with API token

Hi guys,

 

as absolute beginner in customized Power Query commands, I would need your help. I am trying to workaround the issue with schedule refresh for dynamic data sources using the Web.Contents and RelativePath for my JSON API requests. However I am stuggling to have it in place.

 

Below is the business cases:

- The web URL consists of the same information except the page (which needs to increment by 1 up to approx. 1000).

https://companyname.fakturownia.pl/invoices.json?api_token=XXXXXXXXXXXXXXXX/companyname &page=1

This is frustrating as the load takes ages (with invoking the function) - ideally I would like to get all data at once. Would there by any simplification which would load data in a more efficient way?

 

Anyway, what I am looking for is to get the data from all pages automatically via schedule refresh on Power BI service.

https://companyname.fakturownia.pl/invoices.json?api_token=XXXXXXXXXXXXXXXX/companyname &page=1

https://companyname.fakturownia.pl/invoices.json?api_token=XXXXXXXXXXXXXXXX/companyname &page=2

https://companyname.fakturownia.pl/invoices.json?api_token=XXXXXXXXXXXXXXXX/companyname &page=3

.................................

https://companyname.fakturownia.pl/invoices.json?api_token=XXXXXXXXXXXXXXXX/companyname &page=1000

 

Currently I am using the solution by MyOnlineTrainingHub (https://www.youtube.com/watch?v=VkDpwSGWPmk&lc=UgwDfQp6xLf3WgtC_-d4AaABAg) however I would need to push this to PBI service with auto refresh.

 

Any solution is much appreciated!

3 REPLIES 3
lbendlin
Super User
Super User

Please show a sanitized version of your Power Query code.

Hi @lbendlin ,

 

as mentioned, I used the code from Scrape Data from Multiple Web Pages with Power Query - YouTube - the only issue is, that I need to refresh the data manually via Desktop. Any attempt to set up schedule refresh will lead to failure.

 

The current code is as per template below:

IvanS_0-1640249934445.png

 

The desired solution is to have a dynamic link (where the sequence of the pages in 1,2,3 ...).

 

I found two articles to this topic that are using Web.Content and RelativePath however I am an newbie to the custom Power Query commands.

Chris Webb's BI Blog: Web.Contents(), M Functions And Dataset Refresh Errors In Power BI Chris Webb'...

Chris Webb's BI Blog: Using The RelativePath And Query Options With Web.Contents() In Power Query An...

Study these documents and apply the methodology they propose. Then report back.

 

It is very difficult / close to impossible to help with API connection issues without having access to that web service.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.