Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I created a list called "MessageID_List".
I use Web.Contents () to get data from the target URL.
There are multiple target pages.
I want to use the value in "MessageID_List" as part of the URL.
How can I achieve this using Power Query?
Solved! Go to Solution.
Hi @wataruf ,
This is the function that makes an https call:
(PageNum as text)=>
let
Source = Web.Page(Web.Contents("https://eddb.io/commodity/" & PageNum, [Timeout=#duration(0, 0, 1, 0)])),
#"Filtered Rows" = Table.SelectRows(Source, each ([Id] = "table-stations-min-buy")),
Data = if Table.RowCount(#"Filtered Rows") > 0 then #"Filtered Rows"{0}[Data] else null
in
Data
You need to modify it to your scenario: replace everything after "=>" with the code on your screenshot and then change [XXXX] on your screenshot to PageNum.
This is how it is called (assuming the query/function name above is Query2😞
let
Source = MeddageID_List, //this referes to your parameters list converted to a table on the next step
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Added Custom" = Table.AddColumn(#"Converted to Table", "Custom", each Query2(Text.From([Column1])))
in
#"Added Custom"
An output of the above will be your list with Tables in the column Custom. You will need to expand it to get the actual content retrieved by Web.Content inside the Query2 function.
Hope this helps.
Kind regards,
John
Thank you for your quick response.
I read the thread that taught you.
However, I didn't know how to use this content for my request.
I will learn what the functions used in the threads mean.
Hi @wataruf ,
This is the function that makes an https call:
(PageNum as text)=>
let
Source = Web.Page(Web.Contents("https://eddb.io/commodity/" & PageNum, [Timeout=#duration(0, 0, 1, 0)])),
#"Filtered Rows" = Table.SelectRows(Source, each ([Id] = "table-stations-min-buy")),
Data = if Table.RowCount(#"Filtered Rows") > 0 then #"Filtered Rows"{0}[Data] else null
in
Data
You need to modify it to your scenario: replace everything after "=>" with the code on your screenshot and then change [XXXX] on your screenshot to PageNum.
This is how it is called (assuming the query/function name above is Query2😞
let
Source = MeddageID_List, //this referes to your parameters list converted to a table on the next step
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Added Custom" = Table.AddColumn(#"Converted to Table", "Custom", each Query2(Text.From([Column1])))
in
#"Added Custom"
An output of the above will be your list with Tables in the column Custom. You will need to expand it to get the actual content retrieved by Web.Content inside the Query2 function.
Hope this helps.
Kind regards,
John
It worked perfectly.
Thank you very much for helping me.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
102 | |
53 | |
21 | |
12 | |
12 |