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.
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.
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
Before configuring a journey, create a Google Workspace 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.
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:

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

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

Figure 3: The 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
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.

Figure 4: Configuring the If condition
You can add OR and AND conditions 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.
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., [email protected].
- 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.

Figure 5: Configuring a Gmail action
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:

Figure 6: The 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.
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
- is the example trigger data pill 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 5Condition: EqualsRight Value: 5Note: 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 containRight Value: SampleWhen 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 22Condition: Does not equalRight Value: 15When 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 withRight Value: DemoWhen 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 withRight Value: SampleWhen 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 withRight Value: JourneyWhen 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 withRight Value: SampleWhen 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 5Condition: Greater thanRight Value: 2Note: 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 7Condition: Greater than equal toRight Value: 6Note: 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 3Condition: Less thanRight Value: 5Note: 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 2Condition: Less thanRight Value: 5Note: 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 trueCondition: Is trueWhen 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 falseCondition: Is not trueWhen 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 abcCondition: Is presentWhen 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 presentWhen 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.
Last modified 1yr ago