Forum Discussion
Creating multiple queries from a list of values
- 2 years ago
parry2k has a good answer related to this: Calling multiple APIs based on a column
Here's a simplified example I've created using a dummy API service:
let Source = #table({"ID"}, {{1}, {3}, {6}}), BaseURL = "https://jsonplaceholder.typicode.com/comments?postId=", ID_Result = Table.AddColumn( Source, "API_Result", each Json.Document(Web.Contents(BaseURL & Number.ToText([ID]))), type list ), Extract_Field = Table.AddColumn( ID_Result, "FirstEmail", each List.First([API_Result])[email], type text ) in Extract_Field
parry2k has a good answer related to this: Calling multiple APIs based on a column
Here's a simplified example I've created using a dummy API service:
let
Source = #table({"ID"}, {{1}, {3}, {6}}),
BaseURL = "https://jsonplaceholder.typicode.com/comments?postId=",
ID_Result = Table.AddColumn(
Source,
"API_Result",
each Json.Document(Web.Contents(BaseURL & Number.ToText([ID]))),
type list
),
Extract_Field = Table.AddColumn(
ID_Result,
"FirstEmail",
each List.First([API_Result])[email],
type text
)
in
Extract_Field
- NuriaZ2 years agoNew Member
I will try to adapt your code to what I need. It looks like it is what I'm asking for.
I'll see if I can make it work because I'm quite new at this.
Thank you. - NuriaZ2 years agoNew Member
I have to say that it has been a bit challenging because, unlike your example, my JSON was a bit more complicated than your example, and it had to be expanded three times.
I finally got it to work (with the help of the Power Query interface in the end) and your code was a great guideline to achieve what I needed.
Thank you