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

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
Theo_MS
Frequent Visitor

Load list of table name in pipeline with foreach

Newbie here!

 

I would like to establish an action that I couldn't find a way or answer.

The purpose is to load a list of specific table names from one source of data.

This list is subject to change (new/modify/delete values).

 

Example, list of tables:

  • Table1
  • Table3
  • Table7

 

What is the best approch?

 

Regards,

Théo

1 ACCEPTED SOLUTION
nilendraFabric
Community Champion
Community Champion

Hello @Theo_MS 

 

To dynamically load a list of tables in Microsoft Fabric pipelines with changing table names, use a metadata-driven approach with Lookup and ForEach activities

 

1 Retrieve Table Names with a Lookup Activity

Use a query or stored procedure to fetch the latest table list from your source system:

Store your table names in a configuration table for easier updates

Ensure the Lookup returns results as an array (e.g., `@activity('Lookup1').output.value`)

Iterate with ForEach Activity
Configure the ForEach activity to process each table

Iterate with ForEach Activity
Configure the ForEach activity to process each table
"items": "@activity('Lookup1').output.value"


 

1. Lookup Activity (Get Table List)
2. ForEach Activity (Iterate Tables)
 If Activity (Filter Table)
Copy Data Activity (Valid Tables)
Optional: Logging Activity (Skipped Tables)

 

https://github.com/Azure/AnalyticsinaBox/tree/main/Fabric/src/deployment/Pattern1and2

 

if this is helpful please accept the answer 

 

View solution in original post

4 REPLIES 4
jpelham
Advocate I
Advocate I

There is another way. You can create a parameter of type array, and enter your list into the default value. Then you use the parameter in the foreach activity and copy data activity. When in the copy data activity you use a query and can keep it simple by using @Item(), or you could write a query. I generally write a query to add columns to every table in the list. The destination will also have to be configured with @Item()

 

Create Parameter:

jpelham_0-1743097663345.png

Configure foreach activity:

jpelham_1-1743097718150.png

Configure copy data activity:

jpelham_2-1743097897494.png

Copy data destination configuration:

jpelham_4-1743098019859.png

 

 

 

 

 

nilendraFabric
Community Champion
Community Champion

Hello @Theo_MS 

 

To dynamically load a list of tables in Microsoft Fabric pipelines with changing table names, use a metadata-driven approach with Lookup and ForEach activities

 

1 Retrieve Table Names with a Lookup Activity

Use a query or stored procedure to fetch the latest table list from your source system:

Store your table names in a configuration table for easier updates

Ensure the Lookup returns results as an array (e.g., `@activity('Lookup1').output.value`)

Iterate with ForEach Activity
Configure the ForEach activity to process each table

Iterate with ForEach Activity
Configure the ForEach activity to process each table
"items": "@activity('Lookup1').output.value"


 

1. Lookup Activity (Get Table List)
2. ForEach Activity (Iterate Tables)
 If Activity (Filter Table)
Copy Data Activity (Valid Tables)
Optional: Logging Activity (Skipped Tables)

 

https://github.com/Azure/AnalyticsinaBox/tree/main/Fabric/src/deployment/Pattern1and2

 

if this is helpful please accept the answer 

 

Hi @nilendraFabric,

 

thanks for you explanation and steps.

 

Currently in pipeline, it seems impossible to use a stored procedure created in a Lakehouse.

The "stored procedure" activity accepts only Warehouse.

 

How can I store table names in a configuration in a Lakehouse?

Do you have different proposal ?


Regards,

Théo

Add a Lookup activity to your pipeline:
• Source: Lakehouse table `config_table`.
• Configure to return all rows (not just the first)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Kudoed Authors