Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nested forEach activity in Azure Data factory V2

I am trying to use two forEach activities to iterate on subfolders of folders with parameters to get metadata of subfolders. I have forEach1 and forEach2 with their own items array. Within the second for loop I need to combine both for loops' item() in a Metada activity to access my dataset like @item1()@item2(). Is this possible?

enter image description here

like image 718
gabi Avatar asked Jun 13 '18 07:06

gabi


People also ask

Can we use nested ForEach activity in Azure?

You can't nest a ForEach loop inside another ForEach loop (or an Until loop). Design a two-level pipeline where the outer pipeline with the outer ForEach loop iterates over an inner pipeline with the nested loop.

Can we use ForEach inside ForEach ADF?

Because ADF doesn't support nested ForEach activities, we'll need to create two pipelines: one to return all datasets within a project and another to subsequently return all tables within each dataset. The first pipeline will iterate over the second pipeline, which will iterate over the tables.

What are the three types of activities that Azure Data Factory supports?

Data movement activities, Data transformation activities, and Control activities are the three types of activities in Azure Data Factory and Azure Synapse Analytics.

How do you use each activity in Azure Data Factory?

Figure 4: Add Foreach Activity in ADF Pipeline Configure the foreach activity click on add dynamic content and use the expressions to get the output of getmetadata activity and list of files. This will be an array of all the files available inside our source folder which we wanted to iterate over upon.


1 Answers

Nested foreach activity is not allowed. But you could use an execute pipeline activity inside the foreach activity. And in the nested pipeline, you could have another foreach.

like image 61
Fang Liu Avatar answered Sep 26 '22 02:09

Fang Liu