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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Web.Contents with more than one URL

Hey, 

 

In future, I need to combine 2 web contents in ONE table - one for historical data and after a website relaunch for the "new" data.

 

currently, the expression is like this:

= Json.Document(Web.Contents("https://www.thisisaplaceholderurl12345.com/"))

 

How can i add a second URL? Ideally as Power Query M...

 

because: I already tried via Get Data/Web/Advanced/URL parts --> but this didn't work out.

 

Thanks & Regards, Steph

 

 

1 ACCEPTED SOLUTION

 

Just follow the same pattern as before, something like this:

let
    Source1 = Json.Document(Web.Contents("https://www.jsonkeeper.com/12345")),
    convToTable1 = Table.FromList(Source1, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    Source2 = Json.Document(Web.Contents("https://www.thisisafunnyurl.com")),
    convToTable2 = Table.FromList(Source2, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    combineQueries = Table.Combine({convToTable1, convToTable2})
in
    combineQueries

 

If you're feeling particularly brave, you can combine the code into single steps for each source:

let
    Source1 =
        Table.FromList(
            Json.Document(Web.Contents("https://www.jsonkeeper.com/12345")),
            Splitter.SplitByNothing(),
            null,
            null,
            ExtraValues.Error
        ),
    Source2 =
        Table.FromList(
            Json.Document(Web.Contents("https://www.thisisafunnyurl.com")),
            Splitter.SplitByNothing(),
            null,
            null,
            ExtraValues.Error
        ),
    combineQueries = Table.Combine({Source1, Source2})
in
    combineQueries

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi Pete,

 

thanks for your answer!

 

I tried Option 2, but I'm not sure, if I got you right:

 

Does it have to look like this?

Source = Table.Combine(Json.Document(Web.Contents("https://www.thisisafunnyurl.com")), Json.Document(Web.Contents("https://www.jsonkeeper.com/12345"))).

 

SteWo_0-1684936266228.png

 

Steph

 

Hi Steph,

 

No, Query1 would be like this:

 

let
    Source = Json.Document(Web.Contents("https://www.thisisafunnyurl.com"))
in
    Source

 

 

Query2 would be like this:

 

let
    Source = Json.Document(Web.Contents("https://www.jsonkeeper.com/12345"))
in
    Source

 

 

And you'd have a new Query3 like this:

 

let
    Source = Table.Combine({Query1, Query2})
in
    Source

 

 

You could reference one of the queries from within the other but, at that point, you may as well go for Option 1, which would look like this:

 

let
    Source1 = Json.Document(Web.Contents("https://www.jsonkeeper.com/12345")),
    Source2 = Json.Document(Web.Contents("https://www.thisisafunnyurl.com")),
    combineQueries = Table.Combine({Source1, Source2})
in
    combineQueries

 

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Anonymous
Not applicable

Seems as if it's going to work...

 

BUT: This error occurred:

 

SteWo_0-1684941737301.png

 

I found a convert-to-table command in another of my (inherited) tables... but how do i adjust the command when dealing with 2 sources now?

 

#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),

 

 

 

Just follow the same pattern as before, something like this:

let
    Source1 = Json.Document(Web.Contents("https://www.jsonkeeper.com/12345")),
    convToTable1 = Table.FromList(Source1, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    Source2 = Json.Document(Web.Contents("https://www.thisisafunnyurl.com")),
    convToTable2 = Table.FromList(Source2, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    combineQueries = Table.Combine({convToTable1, convToTable2})
in
    combineQueries

 

If you're feeling particularly brave, you can combine the code into single steps for each source:

let
    Source1 =
        Table.FromList(
            Json.Document(Web.Contents("https://www.jsonkeeper.com/12345")),
            Splitter.SplitByNothing(),
            null,
            null,
            ExtraValues.Error
        ),
    Source2 =
        Table.FromList(
            Json.Document(Web.Contents("https://www.thisisafunnyurl.com")),
            Splitter.SplitByNothing(),
            null,
            null,
            ExtraValues.Error
        ),
    combineQueries = Table.Combine({Source1, Source2})
in
    combineQueries

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




BA_Pete
Super User
Super User

Hi Steph,

 

Two options:

 

-1- Duplicate your original source line in Advanced Editor. Rename the original Source step to Source1, and the new one to Source2. Amend the URL in Source2 to point to the new endpoint. You now have both sources loading into the same query that can be individually referenced, such as Table.Combine({Source1, Source2}) if you want to append them, and so on.

 

-2- Duplicate your original query and adjust the URL in the second one to the new endpoint. Same usage as above, but now you will just reference query names instead of step names, such as Table.Combine({oldQuery, newQuery}).

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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