cancel
Showing results for 
Search instead for 
Did you mean: 

Call an API to multiple tables in a Single Job

lalatendujena
Deputy Chef II
Deputy Chef II

I want to call multiple GET APIs from my recipe. In Step 6, I am currently calling one GET API, but I need to retrieve data from multiple data stores using the same step/API. Essentially, I want to pass the name of the data store (API endpoint) at runtime.

Let's say I have the API like this -> xyz.com/api/data/DatastoreTable1

So in runtime it can be DatastoreTable1, DatastoreTable2, DatastoreTable3...

I created a variable for this purpose, but it did not work.

Appreciate any assistance.

 

Screenshot 2026-02-16 at 9.50.40 AM.png

2 ACCEPTED SOLUTIONS

Hello @lalatendujena ,

In order to access the variable as a list in the for loop, it should be created in the way shown in the below images.

However, my suggestion would be to use a lookup or datatable, as that will be easier and more maintainable. If we go with a variable approach, then all the Request URLs need to be added to a list and accessed inside the loop, which can be a bit of a hassle.

  • If you already have the list, it will be easy to pass it at runtime.

  • If the list is not already available, creating and maintaining it using variables can be a hassle.

  • A separate list/loop again is required to add and store all those Request URLs.

  • If any endpoint needs to be updated in the future, it has to be changed at the recipe level.

  • Updating endpoints directly in the recipe is not a good practice and can be difficult to maintain.

according to me keeping all the endpoints in another location (like a lookup or datatable) and retrieving them when needed would be a better and more manageable approach.

Screenshot 2026-02-17 084927.pngScreenshot 2026-02-17 084910.png

View solution in original post

francbaviello
Deputy Chef III
Deputy Chef III

Hi @lalatendujena , you can create a list with a specific schema and a fixed list of items "DataTable1, DataTable2...". You can see the correct solution:
VarList.png

View solution in original post

8 REPLIES 8

Bhagya_pola
Executive Chef I
Executive Chef I

Hello @lalatendujena ,
The simple and easy suggestion to implement would be, storing all these records either into a lookup or data table (better lookup 🙂 ) and retrieve those entries in recipe.

Let me know if this approach doesn't work for you or need a better approach.

Thank you @Bhagya_pola for this, 

Using a lookup table or a data table was my initial thought, but I preferred to use a variable where I could simply create a list of strings to solve my problem. Since I only need to pass the table names dynamically in the API URL at runtime, I thought this approach would be simpler.

However, I ran into an issue with mapping the variable. I’m not sure which datapills to map from the available options (from a for loop), and that’s where I got stuck.

Screenshot 2026-02-16 at 9.31.50 PM.png

 

 

Hello @lalatendujena ,

In order to access the variable as a list in the for loop, it should be created in the way shown in the below images.

However, my suggestion would be to use a lookup or datatable, as that will be easier and more maintainable. If we go with a variable approach, then all the Request URLs need to be added to a list and accessed inside the loop, which can be a bit of a hassle.

  • If you already have the list, it will be easy to pass it at runtime.

  • If the list is not already available, creating and maintaining it using variables can be a hassle.

  • A separate list/loop again is required to add and store all those Request URLs.

  • If any endpoint needs to be updated in the future, it has to be changed at the recipe level.

  • Updating endpoints directly in the recipe is not a good practice and can be difficult to maintain.

according to me keeping all the endpoints in another location (like a lookup or datatable) and retrieving them when needed would be a better and more manageable approach.

Screenshot 2026-02-17 084927.pngScreenshot 2026-02-17 084910.png

Thank you @Bhagya_pola , 

These details make sense to me. I can use the data table for this case and will complete the required mapping. I will let you know if I face any issues.

I appreciate your assistance.