Parameter Query in Power Query - component of website

albertan

Board Regular
Joined
Nov 16, 2014
Messages
68
Office Version
  1. 365
I have a power query table that is consuming a specific table from the website. However I need to make it dynamic so that it can refer to a cell in my excel so that the table source could be changed otherwise I have to go to Advanced Editor and manually change the table number. Is it possible to make this table number dynamic (i.e. change the table number F111 to F112 table for example that I can change in excel cell location) when I have the this in Advanced Editor:

Source = Web.Page (Web.Contents ("https://XXXX.com/F111"))
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
This may be somewhat similar to the post, see if the reply I provided there will be of assistance.

 
Upvote 0
In my case, it's a different situation, I get the data from an external website. And the structure of the website is that the last 4 digits refer to the table name. I have a list of those tables which I'd like to be dynamically changing the source data each time I change the source table (which is a portion of the https' website). Thanks
 
Upvote 0
What johnny's solution indicates is that you can bring a Named Range into Power Query:
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="WebTarget"]}[Content],
    Column1 = Source{0}[Column1]
in
    Column1
That is brought in as a single cell table. The Column1 step above is [Right Click] Drill Down of that cell.
In the code above, WebTarget is a single cell named range which is a Data Validation list.
Cell Formulas
RangeFormula
C1:C3C1=TEXTAFTER(A1,"/",5)
Cells with Data Validation
CellAllowCriteria
C5List=$C$1:$C$3


Point that to the list of 4 digits you have, and incorporate it into your Web query.
Power Query:
let
    Source = Web.Page(Web.Contents("https://www.mrexcel.com/board/threads/" & WebTarget)),
    Data0 = Source{0}[Data]
in
    Data0
You can hard code the base URL (https://www.mrexcel.com/board/threads/) using a LET statement in the query, or even bring it in as a Named Range from a Worksheet.
 
Upvote 0

Forum statistics

Threads
1,223,989
Messages
6,175,804
Members
452,670
Latest member
nogarth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top