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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Loop through series of APIs into single table

Hi,

 

I'm trying to loop through a series of API's querying a series of AssetIDs and put them into a single table. The API URLs follow a simple structure like this

https://environment.data.gov.uk/arcgis/rest/services/EA/AIMSBeachStructure/FeatureServer/0/query?whe...


https://environment.data.gov.uk/arcgis/rest/services/EA/AIMSBeachStructurePoint/FeatureServer/0/quer...

 

The elements of the URL that will change for each API are this

AIMSBeachStructure/FeatureServer/0

and for each AssetID are this

frms_code+%3D+%27FR%2F09%2FS048%27

 

Is there a way to pass a list of API elements and seperately a list of Asset ID's, maybe even from an external source and have Power BI loop through each combination to create a single table? 

 

Thanks in advance

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

A custom function in power query is the way to go. If you load the results from a single call to the API you can go through all the necessary steps to clean or transform the data and then turn that entire query into a custom function, to which you will pass the Asset ID.

If you're making calls to 2 separate end points then they will probably both need to be separate functions although you may be able to combine them.

Once you have the custom functions defined you will need a table containing the Asset IDs you want to get data for. Add a column invoking your custom function using the Asset ID as a parameter then expand that new column to get the data you need.

View solution in original post

1 REPLY 1
johnt75
Super User
Super User

A custom function in power query is the way to go. If you load the results from a single call to the API you can go through all the necessary steps to clean or transform the data and then turn that entire query into a custom function, to which you will pass the Asset ID.

If you're making calls to 2 separate end points then they will probably both need to be separate functions although you may be able to combine them.

Once you have the custom functions defined you will need a table containing the Asset IDs you want to get data for. Add a column invoking your custom function using the Asset ID as a parameter then expand that new column to get the data you need.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors