Forum Discussion

NuriaZ's avatar
NuriaZ
New Member
2 years ago
Solved

Creating multiple queries from a list of values

I hope that someone can help me. I have an Excel sheet with a list of names golf players and their license numbers. There's a website where I can get their game data but I have to search by license...
  • AlexisOlson's avatar
    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