Ankush Jain
Ankush Jain

Reputation: 7079

Prevent triggering next activity if no files were copied in previous activity in Azure Data Factory

I am using Azure Data Factory to copy the data from one Blob Storage Account to Data Lake Storage Gen2 account.

I have created a pipeline and created a copy activity inside that. I trigger this pipeline from a Timer Trigger Azure Function using C# SDK.

I am copying only incremental data by making use of Filter by last modified feature. I am passing UTC StartTime and EndTime.

Now, the question is - I don't want to trigger the second activity if no files are found within this range. How can I do that?

Upvotes: 0

Views: 243

Answers (1)

Steve Johnson
Steve Johnson

Reputation: 8690

You can use If Condition activity, and check whether has files through this expression: @greater(activity('Copy data1').output.filesWritten,0). Then put the second activity into case True activity like this:

enter image description here

Upvotes: 1

Related Questions