Referencing A Text String (URL) In A Power Query

New Contributor

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 that Power Query looks like:


Source = Csv.Document(Web.Contents("}"
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true])
#"Promoted Headers"


Instead of hard coding the entire text string for the URL, I want to build up the text string (parameterize it) in an Excel cell so that I can reference various values in the spreadsheet, then pull that string into the query source statement above.

I have found some online resources for building a Power Query to reference a specific cell on a spreadsheet.

How do I then reference that parameter correctly in this Source statement?

5 Replies
best response confirmed by JonInPDX (New Contributor)


If that's one cell parameter, you may name such cell


query it and use as parameter

    GetURL = Excel.CurrentWorkbook(){[Name="URLstring"]}[Content][Column1]{0},
    Source = Csv.Document(Web.Contents(GetURL),[Delimiter=","]),
    #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true])
    #"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.

@Sergei Baklan Fantastic! That worked perfectly. Thank you!

@JonInPDX , you are welcome

Is 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?


Power Query doesn't know which worksheet is active. You may define names on sheets level and when use same name combines with sheet name