Forum Discussion

antonb's avatar
antonb
Frequent Visitor
9 years ago
Solved

loop through sources

Hi all,   I'm new to this community so I hope that i got the location right..   background: I want to build someting around the webAPI's of the task tool Nozbe. You can organize your tasks in pr...
  • Eric_Zhang's avatar
    Eric_Zhang
    9 years ago

     It's all about getting third party data via API's


    antonb

     

    If I got your idea correctly, you could store the parameters in one column and call the API row by row. Check a simple demo below. You could check the returned json by clicking Moscow weather json.

     

    let
        Source = Table.FromRecords({  
      
        [city= "Moscow",cid=524901],  
      
        [city= "Paris",cid=2988507],  
      
        [city= "London",cid=2643743]}),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"cid", type text}}),
        #"Added Custom" = Table.AddColumn(#"Changed Type", "responseJson", each Json.Document(Web.Contents("http://api.openweathermap.org/data/2.5/forecast/city?id="&[cid]&"&APPID=76acd9a867adb4cd9120298d16b3655f")))
    in
        #"Added Custom"