Get power query content from a cell

vivis93

New Member
Joined
Sep 12, 2015
Messages
21
Hi it is possible to replace a text in the source of power query from a cell in sheed eg.
Code:
let
    Source = Xml.Tables(Web.Contents("http://api.openweathermap.org/data/2.5/forecast/daily?q=[B]Old%20Trafford,%20Sir%20Matt%20Busby%20Way,%20Stretford,%20Manchester%20M16%200RA,%20UK[/B]&mode=xml&units=metric&cnt=15"))
in
    Source
i want the text Old%20Trafford,%20Sir%20Matt%20Busby%20Way,%20Stretford,%20Manchester%20M16%200RA,%20UK
to be replaced automatically with the cell A1 from the sheed2
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
You need to give your cell the name: "Substring". Then the following code should work, provided that you switch to Fast Combine in your Privacy Setting:

Code:
let
    Source = Xml.Tables(Web.Contents("http://api.openweathermap.org/data/2.5/forecast/daily?q="&Excel.CurrentWorkbook(){[Name="Substring"]}[Content]{0}[Column1]&"&mode=xml&units=metric&cnt=15"))
in
    Source

see also: Iterating over multiple pages of web data using Power Query | Matt Masson
 
Upvote 0

Forum statistics

Threads
1,224,120
Messages
6,176,493
Members
452,732
Latest member
EWRUCK

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