Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Running Multiple web calls from a single web query

hi everyone I wonder if anybody out there can help. I am making an api call in to our TFS server on prem that brings back a list off all work items (work item id) and their relevant urls what I need to do is make an individual web call for each item on the list automatically to get detailed info about each work item. The second query is more standard. http://xxxxxxxx.uk:8080/tfs/ManagedSystems/_apis/xxxxx/workItems/xxxxxx I've tried following this https://satalyst.com/power-query-creating-a-parameterized-function-in-m/ but I cant work out how to configure the initial api call I have to make to reflect the parameter I need ( the work item id. Are there any alternative ways to do this. Many thanks for your advice as ever

 

so in an update to this - this is the M im using to create the function - i dont know why but it wont give me any results when making the API call to TFS 

 

let workitems = (id as text) =>
 
let
    Source = Json.Document(Web.Contents("http://tfs.XXXXuk:XXXX/tfs/ManagedSystems/_apis/wit/workItems/"& id &"" )),
    workItems = Source[workItems],
    #"Converted to Table" = Table.FromList(workItems, Splitter.SplitByNothing(), null, null, ExtraValues.List),
    #"Extracted Values" = Table.TransformColumns(#"Converted to Table", {"Column2", each Text.Combine(List.Transform(_, Text.From)), type text}),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Extracted Values", "Column1", {"id", "url"}, {"Column1.id", "Column1.url"}),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded Column1",{"Column2"})
in
    #"Removed Columns"
in workitems

  • Anonymous's avatar
    Anonymous
    7 years ago

    hi Anonymous ,

     

    I could't get this to work effectively so i the end we've just forced the project off TFS and on to DEV OPS.

     

    The connector for this works extremely well.

     

    Thanks for your  advice

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    I'd like to suggest you take a look at following link about iteration looping multiple pages:

    Iterating over multiple pages of web data using Power Query

    Notice: power bi service still not support custom functions. These invoke custom function formulas may not works on power bi service side.

    Regards,

    Xiaoxin Sheng

    • Anonymous's avatar
      Anonymous
      Not applicable

      hi Anonymous ,

       

      I could't get this to work effectively so i the end we've just forced the project off TFS and on to DEV OPS.

       

      The connector for this works extremely well.

       

      Thanks for your  advice