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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
sboulanger1986
New Member

API call for each record of another API call

Hi everyone,

 

I'm working with an API that let me 

  1. Retrieve all contacts within a list.
  2. Retrieve all email messages for a specific contact.

I need to extract all email messages for all the contacts identified in my first API call. The first call will provide me with the contact ID I need for the second call. It involved I'll need to make a call for each record returned in the first place. 

 

Is there a way I can do this in Power Query and does it make sense in terms of performance? 

 

Regards

 

1 ACCEPTED SOLUTION

Yes.  Add a custom column in your first query and do Web.Contents("your url" & [ColumnFromFirstWebCall]), where you concatenate the column with the rest of your url.

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

3 REPLIES 3
mahoneypat
Employee
Employee

Performance will depend on how many there are but it can be done within the query editor.  Just make your first API call, expand that to a table and transform as needed, and then add a custom column that uses the contact column in the second API call fo reach row.

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Hi Pat,

 

Thank you for your answer. I must say I'm still new to Power Query and I'm not sure how to dot it. Should I add custom column in the first query and then add the second API call in that column? 

Yes.  Add a custom column in your first query and do Web.Contents("your url" & [ColumnFromFirstWebCall]), where you concatenate the column with the rest of your url.

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors