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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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