Forum Discussion
Web.Contents with more than one URL
- 3 years ago
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 combineQueriesIf 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 combineQueriesPete
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"))).
Steph
- BA_Pete3 years agoSuper User
Hi Steph,
No, Query1 would be like this:
let Source = Json.Document(Web.Contents("https://www.thisisafunnyurl.com")) in SourceQuery2 would be like this:
let Source = Json.Document(Web.Contents("https://www.jsonkeeper.com/12345")) in SourceAnd you'd have a new Query3 like this:
let Source = Table.Combine({Query1, Query2}) in SourceYou 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 combineQueriesPete
- Anonymous3 years agoNot applicable
Seems as if it's going to work...
BUT: This error occurred:
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),
- BA_Pete3 years agoSuper User
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 combineQueriesIf 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 combineQueriesPete