If Condition

Using the IF condition in Quickwork Journey Builder. Quickwork is a no-code, API-based SaaS platform with pre-integrated apps to automate business workflows.

If Condition acts as a gateway where a journey executes successfully only when a specified condition is met. The output received from the trigger and previous action(s) is checked thoroughly by If Condition and then it's passed to the actions downstream. In case the condition is not satisfied, If Condition prohibits the data flow and the execution of the journey is terminated.

You can use If Condition between a trigger and action or action and action, depending on your use case.

Let's understand the functioning of If Condition using Gmail to Gmail journey. Click here to know how to set up this journey in detail.

In this example journey, we will use the Contains If Condition. The journey use case is "Fetch a new email in Gmail and send it to another email(s) via Gmail if the subject of a received email contains the word, Demo".

Step 1: To configure a Gmail trigger, follow these steps:

  1. Under the Trigger section, search for the Gmail app and click on it.

  2. Then select the trigger event, Get email, from the Triggers list.

  3. Authorize Gmail by selecting an existing connection from the drop-down or creating a new connection.

  4. Select the label INBOX from the drop-down menu in the Label field:

Figure 1: The Gmail trigger

Step 2: Now, let's use the If Condition feature. Under the Steps section, click the Business Logic option and select If Condition:

Figure 2: If Condition

The Setup If condition block will appear with a pre-indented action bar as illustrated here:

Figure 3: If condition structure

You will get the following fields to which input is to be specified:

  1. Specify a value in the Left Value field by placing the Subject key from the Gmail | Get email Trigger-Data Tree Output on the right-hand side of the screen.

The Left Value field acts as an input to the If Condition. The input of this field is the output of the trigger or previous actions used.

2. Select the Contains condition from the drop-down in the Condition field. 3. Specify a value in the Right Value field. To do so, enter the keyword Demo.

An input provided in the Right Value field is a keyword satisfying the condition. It can be a string, integer, date, or timestamp.

Figure 4: Specifying input and condition

You can add OR and AND conditions between 2 or more If Conditions by clicking the Add condition button. This will create a nested if condition which will handle severe complexities within a journey.

Step 3: Configure the Gmail action - Send an email. Click here to know the Gmail action configuration in detail.

The Gmail to Gmail journey looks like this after finishing the configuration:

Figure 5: Gmail to Gmail - If Condition journey

The journey is now configured successfully. Click the Save changes button and start the journey. Whenever the Gmail trigger fetches a new email, If Condition will check the subject line for the word Demo. If the condition gets satisfied, an email will be sent to the email ID(s) specified in the Gmail action. Else the journey will terminate.

Types of conditions

Let's take a tour of If Conditions that Quickwork Journey Builder offers: Points to remember:

  • All the conditions are case sensitive and support all the data types as an input and output value

  • is the example trigger key used to explain the conditions

  1. Equals The Left Value field (input) equals a value specified in the Right Value field (output).

    Example:

    Left Value: Let's say the value of this is 5

    Condition: Equals

    Right Value: 5

    Note: In the case of the string data type, the comparison is made based on the ASCII value.

    When you run the journey, the Condition field will check whether the value of (which is 5) is equal to value 5 or not. If yes, the defined condition is met, and the journey will proceed to the next action.

  2. Contains The Left Value (input) field should contain a keyword in the text specified in the Right Value field (output). Example: Left Value: Let's say the value of this is Demo Journey. Condition: Contains Right Value: Demo When you run the journey, the Condition field will check whether the value of (which is Demo Journey) contains the keyword Demo or not. If it contains the keyword specified, the defined condition is met and the journey will proceed to the next action.

  3. Does not contain The Left Value (input) field should not contain a keyword in the text specified in the Right Value field (output).

    Example:

    Left Value: Let's say the value of this is Demo Journey.

    Condition: Does not contain

    Right Value: Sample

    When you run the journey, the Condition field will check whether the value of (which is Demo Journey) contains the keyword Sample or not. If it does not contain the keyword specified, the defined condition is met and the journey will proceed to the next action.

  4. Does not equal The Left Value (input) field input should not be equal to the value specified in the Right Value field (output).

    Example:

    Left Value: Let's say the value of this is 22

    Condition: Does not equal

    Right Value: 15

    When you run the journey, the Condition field will check whether the value of (which is 22) is equal to 15 or not. If it is not identical to the keyword specified, the defined condition is met and the journey will proceed to the next action.

  5. Starts with The Left Value (input) field input should start with a keyword specified in the Right Value field (output).

    Example:

    Left Value: Let's say the value of this is Demo Journey.

    Condition: Starts with

    Right Value: Demo

    When you run the journey, the Condition field will check whether the value of (which is Demo Journey) starts with the keyword Demo or not. If it begins with the keyword specified, the defined condition is met and the journey will proceed to the next action.

  6. Does not start with The Left Value field (input) should not start with a keyword specified in the Right Value field (output).

    Example:

    Left Value: Let's say the value of this is Demo Journey.

    Condition: Does not start with

    Right Value: Sample

    When you run the journey, the Condition field will check whether the value of (which is Demo Journey) starts with the keyword Sample or not. If it does not begin with the keyword specified, the defined condition is met and the journey will proceed to the next action.

  7. Ends with The Left Value field (input) should end with a keyword specified in the Right Value field (output).

    Example:

    Left Value: Let's say the value of this is Demo Journey.

    Condition: Ends with

    Right Value: Journey

    When you run the journey, the Condition field will check whether the value of (which is Demo Journey) ends with the keyword Journey or not. If it ends with the keyword specified, the defined condition is met and the journey will proceed to the next action.

  8. Does not end with The Left Value field (input) should not end with a keyword specified in the Right Value field (output).

    Example:

    Left Value: Let's say the value of this is Demo Journey.

    Condition: Does not end with

    Right Value: Sample

    When you run the journey, the Condition field will check whether the value of (which is Demo Journey) does not end with the keyword Sample or not. If it does not end with the keyword specified, the defined condition is met and the journey will proceed to the next action.

  9. Greater than The Left Value field (input) should be greater than a value specified in the Right Value field (output).

    Example:

    Left Value: Let's say the value of this is 5

    Condition: Greater than

    Right Value: 2

    Note: In the case of the string data type, the comparison is done on the basis of the ASCII value.

    When you run the journey, the Condition field will check whether the value of (which is 5) is greater than the value 2 or not. If yes, the defined condition is met and the journey will proceed to the next action.

  10. Greater than equal to The Left Value field (input) should be greater than or equal to a value specified in the Right Value field (output).

    Example:

    Left Value: Let's say the value of this is 7

    Condition: Greater than equal to

    Right Value: 6

    Note: In the case of the string data type, the comparison is based on the ASCII value.

    When you run the journey, the Condition field will check whether the value of (which is 7) is greater than or equal to the value 6 or not. If yes, the defined condition is met and the journey will proceed to the next action.

  11. Less than The Left Value field (input) should be less than a value specified in the Right Value field (output).

    Example:

    Left Value: Let's say the value of this is 3

    Condition: Less than

    Right Value: 5

    Note: In the case of the string data type, the comparison is done on the basis of the ASCII value.

    When you run the journey, the Condition field will check whether the value of (which is 3) is less than the value 5 or not. If yes, the defined condition is met and the journey will proceed to the next action.

  12. Less than equal to The Left Value field (input) should be less than or equal to a value specified in the Right Value field (output).

    Example:

    Left Value: Let's say the value of this is 2

    Condition: Less than

    Right Value: 5

    Note: In the case of the string data type, the comparison is done on the basis of the ASCII value.

    When you run the journey, the Condition field will check whether the value of (which is 2) is less than the value 5 or not. If yes, the defined condition is met and the journey will proceed to the next action.

  13. Is true The Left Value field (input) should be true. In this case, you don't need to specify the value in the Right Value field.

    Example:

    Left Value: Let's say the value of this is true

    Condition: Is true

    When you run the journey, the Condition field will check whether the value of (which is true) is true or not. If yes, the defined condition is met and the journey will proceed to the next action.

  14. Is not true The Left Value field (input) should not be true. In this case, you don't need to specify the value in the Right Value field.

    Example:

    Left Value: Let's say the value of this is false

    Condition: Is not true

    When you run the journey, the Condition field will check whether the value of (which is false) is false or not. If yes, the defined condition is met and the journey will proceed to the next action.

  15. Is present The Left Value field (input) should be present. In this case, you don't need to specify the value in the Right Value field.

    Example:

    Left Value: Let's say the value of this is abc

    Condition: Is present

    When you run the journey, the Condition field will check whether the value of (which is abc) is present or not. If yes, the defined condition is met and the journey will proceed to the next action.

  16. Is not present The Left Value field (input) should not be present. In this case, you don't need to specify the value in the Right Value field.

    Example:

    Left Value: Let's say the value of this is ""

    Condition: Is not present

    When you run the journey the Condition field will check whether the value of (which is "") is unavailable or not. If yes, the defined condition is met and the journey will proceed to the next action.