cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
michaelshparber
Helper III
Helper III

Dynamic Nested API Calls

Hello, 

Because of how the API is structure I am not able to pull in the data I need in one call. 

I need to get all the students' attendance, classes and grades.

So, first: "http://url/api/students"  - I get a list of all students

Then "http://url/api/[StudentID]/classes " - I get a list of classes for a specific student

Then http://url/api/[StudentID]/[ClassID]/attendance - attendance for a specific student for a specific class

And finally,  http://url/api/[StudentID]/[ClassID]/grades 

I managed to do this in Power BI with Power Query functions and it's working fine, but I need to save my data to a database, so Power BI doesn't fit.

I am new to Power Automate, but played around a bit and did quite a bit of searching.

Please help.

4 REPLIES 4
abm
Super User
Super User

Hi @michaelshparber 

 

In Power Automate you need to use the HTTP action step for executing the API.

 

Once the data is returned you could store all in an array. Finally once you had all the data you could loop the array and collect all the results in one array. Finally iterate the array to push the data to your database.

 

If you need any further help in this please let me know.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

@abm 

Thank you, that's exactly what I am looking for.

I need more details, please.

How do I loop through array, firing more API calls and gathering and adding their results?

Let's say I first call http://url/api/students API, that returns list of students

Then I need for loop and for each student call http://url/api/[StudentID]/classes API - and gather and append the results...

Then - insert to SQL.

I totally understand that this should be the logic, but how to actually implement it?

I've searched a lot, but couldn't find anything similar...

If you have links to examples or YouTube - it'll be awesome!

Thanks a lot in advance!

Michael

Hi @michaelshparber 

 

It's difficult to show it as an example. It would be easier I could help you via screen share.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
lokeshpatel
Frequent Visitor

Hi @michaelshparber 

 

I am trying to do something very similar in PBI. I have gotten it to work but it takes a very long time as I have a lot of records. Can you show me an example of what you did in PBI?

 

Thanks in advance!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (1,826)