Quickwork
  • Table of contents
  • What is Quickwork
  • Getting started
  • Terminologies
  • Understanding the Quickwork platform
  • Understanding the Journey Configuration Manager
  • Folders
  • Triggers
  • Actions
  • Connection
  • Creating your first journey
  • Data masking
  • Clone, comment, and delete
  • History, connections, versions, and settings
  • Customized Transaction Table
  • Sharing and moving a journey
  • Account settings
  • If Condition
  • If Condition using OR operator
  • If Else Condition
  • Foreach Loop
  • Try Catch
  • Stop Journey
  • Scheduler by Quickwork
  • Logger
  • Callable Journey
  • API Management
    • API Management Terminologies
    • A journey for API Management implementation
    • Creating an API
  • Databases
  • Constants
  • Team
  • Audit Logs
  • Quickwork Embedded - Getting Started
Powered by GitBook
On this page
  • Use case
  • Prerequisites
  • Configuring a trigger
  • Configuring the If Condition
  • Configure the Gmail action
  • Types of conditions

Was this helpful?

If Condition

Harness your workflows with the business logic of If Condition to ensure that automations execute only when a specific condition is met. This avoids a user getting results for every trigger event.

PreviousAccount settingsNextIf Condition using OR operator

Last updated 3 years ago

Was this helpful?

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 doesn't execute the actions configured in the If block.

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

Let's consider a business use case to understand If Condition in a more realistic way.

Use case

Fetch a new email in Gmail and send it to another email via Gmail if the subject of the received email contains the word, Demo. In this use case, we will use the Contains condition.

  • Trigger: Gmail-Get email

  • Condition: If Condition as a business logic with Contains as a condition

  • Action: Gmail - Send email

Prerequisites

Before configuring a journey, create a account to have an official Gmail account ready to implement the use case.

Quickwork supports two types of Gmail connectors:

  1. Gmail: This connector is used to connect the official Google Workspace account with Quickwork and perform the tasks accordingly. It requires authorization to establish the connection.

  2. Gmail Secondary: This connector is used to connect a personal Gmail account with Quickwork and perform the tasks accordingly. It requires authentication (client ID and client secret) to establish the connection.

Configuring a trigger

To configure a Gmail trigger, follow these steps:

  1. Under the Event 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:

Configuring the If Condition

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

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

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 data pill 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 the Demo keyword as the value in the Right Value field.

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

Configure the Gmail action

The following fields will open up in which you need to enter the details:

  1. To (required): Enter the email ID of the recipient to whom you want to send an email. E.g., johndoe@gmail.com.

  2. Subject (required): Enter the subject of the email you want to send

  3. Message (required): Enter the email in rich format text you want to send. The entire email message field is RFC 2822 formatted and supports the base64url writable encoded string. You can also drag and drop the Body as HTML data pill from the output of the Get email trigger under the Data Tree Output.

There are some optional fields such as Cc, Bcc, Attachments, etc. to which you can specify the URL of the file and its name that you want to send with the email.

The Gmail to Gmail journey looks like the following screenshot after completing the configuration:

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 offers: Points to remember:

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

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

    Example:

    Condition: Equals

    Right Value: 5

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

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

    Example:

    Condition: Does not contain

    Right Value: Sample

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

    Example:

    Condition: Does not equal

    Right Value: 15

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

    Example:

    Condition: Starts with

    Right Value: Demo

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

    Example:

    Condition: Does not start with

    Right Value: Sample

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

    Example:

    Condition: Ends with

    Right Value: Journey

  7. 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

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

    Example:

    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.

  9. 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:

    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.

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

    Example:

    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.

  11. 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:

    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.

  12. 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:

    Condition: Is true

  13. 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:

    Condition: Is not true

  14. 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:

    Condition: Is present

  15. 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:

    Condition: Is not present

You can add between 2 or more If Conditions by clicking the Add condition button. It creates a nested If Condition that can handle severe complexities within a journey.

is the example trigger data pill used to explain the conditions

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

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.

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.

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

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.

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

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.

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

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.

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

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.

Left Value: Let's say the value of this is Demo 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.

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.

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

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.

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

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.

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

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.

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

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.

Left Value: Let's say the value of this 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.

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

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.

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

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.

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

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.

Google Workspace
OR and AND conditions
Figure 1: The Gmail trigger
Figure 2: The If Condition
Figure 3: The If Condition structure
Figure 4: Configuring the If condition
Figure 5: Configuring a Gmail action
Figure 6: The If Condition journey