Forum Discussion
How To Exit Pipeline Successfully On Condition
- 1 year ago
Thanks Ben, I've got something like this set up and working. The issue is I can't add all my activities into the if activity as some of them are for loops and more if activites as well which aren't supported within an if activity.
I've reworked the pipeline to remove the loops and if conditions from within the if block and have got things working now. I've also started using pipeline return parameters which has helped as well.
Hi russellhq,
You could use Get metadata with child items to check whether there are files in the folder at all. After your Get metadata activity, you can connect an If condition and check if there are 1 or more files in the folder. The condition for the If condition could be: @greater(length(activity('Get Metadata1').output.childItems), 0). Put all your activities in the True section of the if condition and nothing in the False section. This way, the pipeline will run succesfully without failures.
I though this would work and gave it a try. But because the actions I want to put in the IF activity are ForEach and IF activities as well, the pipeline doesn't allow them inside an IF block.