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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
eurenergy
Frequent Visitor

How to avoid a nested ForEach activity and a json settings file

I have the pipeline belwo which works great. It works for a single process and uses paths etc for this process.

eurenergy_0-1741255728795.png

 

However, I need to use this pipeline for five processes, (in which some settings are different every run, like the path it takes files from, the file type, and the destination tables). 

So my solution:

Add a lookup activity which looks up a json file stored in my lakehouse. This json file has all the settings for each of the processes:

eurenergy_3-1741256229839.png

 

Then: I would copy the pipeline mentioned earlier as a whole in a ForEach activity, so the correct settings are applied on each run. This would like like the below:

eurenergy_2-1741256018532.png

 

 

However, the problem is that in data factory, it is not possible to use a ForEach activity within a ForEach activity.... And I do really need these ForEach activity's to copy multiple files etc.

So my question is: how to do this in an elegant, dynamic way? 

A solution would be to copy the whole pipeline, paste it 5 times under each other. But then if I need to make a change i need to do it 5 times.

 

1 ACCEPTED SOLUTION
NandanHegde
Super User
Super User

you can trigger an Execute pipeline activity from within a for each activity.

So you can have a pipeline with your main framework and call that pipeline from within foreach activity in another pipeline




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com

View solution in original post

1 REPLY 1
NandanHegde
Super User
Super User

you can trigger an Execute pipeline activity from within a for each activity.

So you can have a pipeline with your main framework and call that pipeline from within foreach activity in another pipeline




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com

Helpful resources

Announcements
September Fabric Update Carousel

Fabric Monthly Update - September 2025

Check out the September 2025 Fabric 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