user14121667
user14121667

Reputation: 1

Azure Data Factory - Get Metadata inside for each activity

folder structure:

raw

Here is what I want to do - use a get metadata activity to get a list of folders inside the raw folder. Then use a Foreach to go through the childitems of the get metadata activity and then inside the for each loop, use another get metadata activity that gets the metadata for every folder(all the test folders). This should work as new test folders are created (will have trigger to run pipeline), every folder will have the same structure and the same files inside but I need the get metadata to be able to work in the future for these folders that don't exist yet.
The issue I'm facing is setting the dataset for the Get Metadata that is inside the for loop since I can't set the dataset to the multiple test folders, some of which dont exist yet. I don't want to have to update the datasets everytime as I want the pipeline to run automatically with a trigger for when a new test folder is created. Thanks!

Upvotes: 0

Views: 2722

Answers (1)

Steve Johnson
Steve Johnson

Reputation: 8660

Please try this:

The screenshot of my pipeline: enter image description here

The dataset of inside Get Metadata Activity: enter image description here

If you aren't sure folder(test1,test2,test3) or csv file(in.csv,out.csv) exists, you can select 'Exists' in Get Metadata Activity like this:

enter image description here

Then you can use this value in output to confirm whether it exists,so you can do something else without error.

enter image description here

Hope this can help you.

Upvotes: 1

Related Questions