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
ptmuldoon
Resolver I
Resolver I

Loop and Combine Web.Contents Query

I am trying to pull data that where I need to set the a 'SiteTag' number.  And I have a list of 50 'SiteTag' numbers.

 

Is there a way that I can loop and combine them all into 1 table?  It will be identical columsn with each query.

 

 

token = AccessToken,
  range = "&BD=1/1/2021&ED=12/31/2021&SiteTag=",
  p3286 = Json.Document(Web.Contents(api_base_url & token & range & "3286", [Headers = [#"Authorization"="Bearer "&token,#"Content-Type"="application/json"]])),
  
  p4401 = Json.Document(Web.Contents(api_base_url & token & range & "4401", [Headers = [#"Authorization"="Bearer "&token,#"Content-Type"="application/json"]])),

 

 

 

I have 50+ 'p####' SiteTags to combine. 

2 REPLIES 2
ptmuldoon
Resolver I
Resolver I

Thansk for the help and feed back.  

I'mnt sure if that article will help as I'm not actually looping pages of website, but querying 50+ separate API calls/URLS to get the JSON data.

 

But I did find this tutorial in using a custom function, and do have this working.  I still need to think the best way I want to generate the list of URLS, but this did help me here.

 

https://community.powerbi.com/t5/Community-Blog/Import-JSON-files-from-multiple-URLs-into-Power-BI-D...

 

amitchandak
Super User
Super User

@ptmuldoon , refer if this can help

https://medium.com/@marktiedemann/how-to-do-pagination-in-power-query-430460c17c78

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.