Forum Discussion
JonInPDX
Sep 04, 2020Copper Contributor
Referencing A Text String (URL) In A Power Query
I am using Excel and Quick Base. Quick Base allows querying data via URL. I have successfully set up and run a query in Excel Power Query from our Quick Base database. Here is an example of what...
- Sep 04, 2020
If that's one cell parameter, you may name such cell
query it and use as parameter
let GetURL = Excel.CurrentWorkbook(){[Name="URLstring"]}[Content][Column1]{0}, Source = Csv.Document(Web.Contents(GetURL),[Delimiter=","]), #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]) in #"Promoted Headers"
If there are few parameters, idea is the same but you organize you parameter into Excel table, query it, combine value into one string and use to access web resource.
SergeiBaklan
Sep 04, 2020Diamond Contributor
If that's one cell parameter, you may name such cell
query it and use as parameter
let
GetURL = Excel.CurrentWorkbook(){[Name="URLstring"]}[Content][Column1]{0},
Source = Csv.Document(Web.Contents(GetURL),[Delimiter=","]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true])
in
#"Promoted Headers"
If there are few parameters, idea is the same but you organize you parameter into Excel table, query it, combine value into one string and use to access web resource.
- JonInPDXSep 04, 2020Copper Contributor
SergeiBaklan Fantastic! That worked perfectly. Thank you!
- SergeiBaklanSep 05, 2020Diamond Contributor
JonInPDX , you are welcome
- BenBennett27Dec 29, 2021Copper ContributorIs there a way to make this query work for a different reference on each sheet? The named range seems to be at a workbook level. I want to have different URLs in multiple sheets. (At the moment if I copy a sheet containing a named range and tables and then change the value in the named range, it still looks up the named range in the first sheet as that is at the workbook level. Is there a way of referencing a cells value in the active sheet? Instead of using a named range?