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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors