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.
Last updated
Was this helpful?
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.
Last updated
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.
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 account to have an official Gmail account ready to implement the use case.
Quickwork supports two types of Gmail connectors:
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.
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:
Under the Event section, search for the Gmail app and click on it.
Then select the trigger event, Get email, from the Triggers list.
Authorize Gmail by selecting an existing connection from the drop-down or creating a new connection.
Select the label INBOX from the drop-down menu in the Label field:
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:
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.
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.
The following fields will open up in which you need to enter the details:
To (required): Enter the email ID of the recipient to whom you want to send an email. E.g., johndoe@gmail.com.
Subject (required): Enter the subject of the email you want to send
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.
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
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.
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
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
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
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
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
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
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.
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.
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.
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.
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
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
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
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.