Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
antonb
Frequent Visitor

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 projects. I want all the tasks and all the projects so I can see the progress of tasks done. basically just because i thing this should be able with Power BI and I want to improve my Power BI skills.

 

current situation:

api for projects fills my project tables (https://webapp.nozbe.com/api/projects/)

but then I have to call the taks below based on the project ID. (https://webapp.nozbe.com/api/actions/what-project/id-????/)

I ve used the combine function to combine multiple queries (taks for project x, y, z).. but that is too fixed (I don't want to change code when I make  a new project)

 

Question:

Is it posible to use a parameter to call the taks of a project and then loop through it.

 

so in simplified code:

For each [projectid] in Projects do:

    tablewithtasks = tablewithtasks + call: https://webapp.nozbe.com/api/actions/what-project/id-[projectid]

 

Thanks in advance,

Anton

 

 

 

 

1 ACCEPTED SOLUTION


 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.

 

Capture.PNG

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"

View solution in original post

4 REPLIES 4
Mcburn
Helper II
Helper II

Hey antonb,

 

do you built your own Visual or you want take your third party data in Power BI?

sry when i missunderstand your question.

 

Nice Regards

 

Mcburn

antonb
Frequent Visitor

hi Mcburn,

 

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

 

 

Thanks!

Anton

 


 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.

 

Capture.PNG

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"

thanks.. that helped a lot!

 

I now have a query that starts with the projects. Than within the same query a extra column is added with the JSON request (with a variable of the projectsID).  

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors