Search code examples
conditional-statementsbooleanazure-data-factory

Based on Boolean value, setup a conditional activity - without using the IF ACTIVITY


I am trying to setup my pipeline such that it uses a condition based on the boolean value and if it is true to continue in a direction of the pipeline, if it is false to continue in another direction.

if it true I want it to continue the top of the pipeline... Set Folder Path etc and if is false to just end the pipeline with the failed slack notification. I want to achieve this without using the IF condition activity as it will mean I will have to integrate the whole continuation of the pipeline within the condition so if this can be achieved in another means, that would be perfect.

enter image description here

enter image description here


Solution

  • I want to achieve this without using the IF condition activity.

    First, I took a simple set variable to get Boolean response.

    enter image description here

    To achieve this scenario, you have to take one set variable activity with demo variable with string type and @if(variables('bool'),'true',0) so if value of variable is true then it will assign string value true to variable and if the value of variable is false it will assign 0 integer value to it and activity will fail.

    enter image description here

    On Succeed you can call activities to run which on true response.

    enter image description here

    On Failure you can call activities to run which on false response.

    enter image description here