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

Join us at the 2025 Microsoft Fabric Community Conference. March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for $400 discount. Register now

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

3 REPLIES 3
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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebFBC_Carousel

Fabric Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors