Logic elements in Zoho Flow

Logic

Logic

Logic helps automate elaborate tasks by introducing custom rules to filter data or defer the execution of a few actions. You can even create your own logic element with custom functions. When used alongside app-based actions, these elements can make your flow more comprehensive.

The logic types available are Flow Control, Notification, and Custom Functions.

Flow Control

Flow Control contains logic elements that streamline your flow according to specific requirements of your business.

Set variable - Create a variable and assign it a constant value or the result of a formula.

Decision - Enable your workflow to execute different actions based on the conditions.

Delay - Delay task executions according to your preferences. There are two types of delay: Delay For and Delay Until.

Notification

Notification consists of logic elements that help you send notifications through your workflows.

Send email- Send an email from a verified email domain through your workflows.


Custom Functions

Create your own function from scratch in Zoho Flow using Deluge script. Learn more


Let's look at each logic element in detail.

Flow Control

Set Variable

With Set Variable, you can create a variable and assign it a value. The value can be constant or the result of a formula.

For example, you can configure age=18. 'age' is the name of your variable and 18 is the constant value you assign. You can also configure age=${trigger.age+10}. The variable 'age' fetches a value from the trigger, adds 10, and stores the result.

To configure Set Variable:

  1. Click the Logic tab on the left side of the builder.



  2. Drag and drop Set Variable from Flow Control.



  3. In the configuration window that opens, the variable name will be auto filled. You can edit the name if needed. When renaming a variable, note that:
    • All names must start with a letter. Variable names can contain alphanumeric characters and underscores.
    • Other characters, such as spaces, are not accepted. Names must be unique to avoid naming clashes.
    • If you use the same variable name for multiple actions, the result of the action executed last will be stored in the variable.
      E.g: discountCalc, dateFormatter2
  4. Enter a value that will be stored in the variable. This can be a direct value(will be considered a string) or the result of a formula. E.g: 180, ${trigger.cost+500}



  5. Click Done.

You will now be able to map this value in the actions that follow.

For example, you can calculate the total price of a bundle in Zoho Inventory along with tax. The Set Variable fetches the amount from Zoho Inventory and performs the configured calculations.



Decision

Decision lets you branch your workflows to check for conditions and perform different tasks. Conditions are the rules you provide (e.g: Ticket Subject contains "issue"). You can provide as many conditions as you need, and define what the flow should do if a set of rules are satisfied.

For example, when a ticket is updated in Zoho Desk, depending on fields like subject or status, you can configure your workflow to perform different tasks, such as creating a task in Zoho Projects, updating a Google spreadsheet, or sending a Slack message.

To configure Decision:

  1. Click the Logic tab on the left side of the builder.

  2. Drag and drop Decision from Flow Control. In the configuration window that opens, there will be two dropdowns, and one field to be filled for each test condition. A test condition is a statement with three elements that needs to be verified. The first dropdown is the list of variables from previous tasks in the flow. The second dropdown is the operation to be performed, and the field is what the variable should be compared with.




    This condition is satisfied if the subject of the updated ticket contains 'error'.

     

    Add Test Conditions
  3. You can add different test conditions in the group or as many groups as required. Every time you add a group or a test condition, a dropdown with AND/OR will appear.
    AND - Output is true only if both the test conditions are true
    OR - Output is true if one or both the test conditions are true




    For example, if the ticket subject contains 'error' or 'issue', the output is true. Now, this is evaluated with the next test condition. Let's assume the classification is not problem . So, the entire output is false and this condition is not satisfied.
  4. When you add test conditions in the same group, the output of each condition in the group is evaluated sequentially to be the output of the entire group. To add a test condition, hover over a test condition to see a +. Click on it to add the next one.



    Add Group

    A group is a collection of test conditions. When you add different groups, the final value is evaluated from the output of each group, rather than the output of each test condition. This is similar to adding parenthesis in Boolean Algebra.
    Consider T to be True and F to be False. When you say T||T&F&T, the calculation is performed sequentially. The AND(&) operation is given more priority than OR(||). So, it becomes T||F&T Next, T||F. So the output is T. This is like adding test conditions in the same group. But when you say (T||T)&(F&T), the calculation within parenthesis is first performed. Taking the value of each group, the total value is computed to be F. This is like adding different groups.
  5. To add a new group, click Add Group.

    This means if the ticket subject contains issue or error, or classification is problem, and is open and overdue, this condition is satisfied.



  6. Click Done.
  7. You can rename the condition by clicking on the condition name.



  8. Add the action that should be performed if this condition is true to the right of the decision box.
    If the condition is true, then a task is created in Zoho Projects.



  9. Add as many conditions as you need by clicking the + below your conditions. You can also add an action to execute when none of the conditions hold true at the bottom of the decision box. This is called the default action.




    Here, a message is sent in Slack channel if both the conditions are false.



    Notes
    Note:
    1. The dropdown will only list the default variables provided by an application. If you need manually configured fields in an application from a trigger or action output, such as Custom Fields in Zoho Projects, you will have to use Set Variable to assign it to a new variable that will be available for all actions and conditions in the flow.

    2. Output variables received from a webhook trigger should also be assigned to new variables using Set Variable to be used in conditions. Learn more



Delay

Delay postpones one or more actions in the flow for a time period or until a specified date. This means you can configure a part of the workflow to execute when it is triggered, and the other part to execute after a certain amount of delay.

For example, you can send an email 30 minutes after a form submission is made. Alternatively, you can send an email on February 20th to those who have registered for your event.

NotesNote: You can use natural language to input dates and time periods into the Delay for option. For example, Flow will accept entries like 3 days, a month, or four weeks. Your current time will be used as the starting time for the duration. If you create a 3-day delay action at 2PM, it will be executed at 2PM three days from the date you created it.

To configure Delay:

  1. Click the Logic tab on the left side of the builder.



  2. Drag and drop Delay from Flow Control. There are two types of Delay: Delay For and Delay Until.
  3. Delay For will be auto-selected. You can choose to delay for any number of minutes, hours, days, or weeks. For example, you can send a thank you email an hour after a purchase order is created in your Zoho Inventory.



  4. You can choose to delay until a particular date you select from the calendar. Click on the month or year to view your options for changing them.




    For example, every time a registration is made for an event, a message can be sent to your Slack channel. Two days before the event, you can schedule a reminder email to be sent to the attendees using the same flow. This flow will send a message to the Slack channel and wait. Two days before the event, the flow will finish executing by sending emails to all the registered email addresses.



  5. Click Done.

What is an If-else block? 

The If-else logic block functions similarly to the Decision block, but instead of multiple branches, you can configure a True path for the flow to take when the given conditions evaluate to a non-zero value, and a False path, otherwise.




For example, in a sales workflow, you can use an If-else block to check if the deal amount is greater than $10,000. If the condition is true, the workflow can create a new form entry — for instance, to notify or assign the deal to your premium sales team. If the condition is false, it can update an existing form entry to route the deal to your regular sales team.

Adding an if-else block: 

  1. Click the Logic tab on the left side of the builder.

  2. Drag and drop If else from Flow Control.

  3. In the configuration window that appears, set the test conditions. You can add more test conditions by hovering over a test condition and clicking the + icon.

    Note:
    You can add different test conditions in the group or as many groups as required. Every time you add a group or a test condition, a dropdown with AND/OR will appear.

    From our earlier example, if you need to check if the deal value is greater than $10000 and also ensure that the company size is greater than 100, you need to add two conditions:
    Deal value > 10000 AND Company size > 100

  4. Similarly, you can add groups of conditions to be compared with each other. When you add test conditions in the same group, the output of each condition in the group is evaluated sequentially to be the output of the entire group. To add a new group, click Add Group.

  5. Add the actions to the bottom of the if else block for them to be performed when the conditions are not met, and to the right of the block for them to be performed when the conditions are met. 


Notification

Send Email action  

The Send Email action allows you to send emails through workflows with the From address of your choice (for example, sales@yourdomain.com). As the emails are sent from Zoho Flow's mail servers, you are required to verify the validity of the From email addresses you provided.
For example, you can configure an email to be sent from your official email address (your company's custom domain) to all candidates who applied for an opening. Though the email will be sent from our auto-generated email address, the Reply to will be set to the sender email address you provide.

To configure Send Email:
  1. Click the Logic tab on the left side of the builder.



  2. Click Notifications.



  3. Drag and drop Send Email to the builder. A configuration window will open where you need to fill in the following details:
    From
    Sender email address (Reply to will be set to this email)
    To
    Recipient email address
    Subject
    Subject of the email
    Message
    Body of the email



  4. For more options, click Advanced options below the message field.
    CC
    Carbon copy. Email addresses you want to forward a copy of this email to.
    BCC
    Blind carbon copy. Email addresses you want to forward a copy of the email to but do not want the other recipients to know.



  5. Click Done.
Alert
Starting from February 1, 2024, users will no longer be able to use Gmail addresses in the From address field when configuring Zoho Flow's send email action. It also applies to the send email task available in custom functions. This change is a result of a policy update from Gmail

We recommend using a non-Gmail address or the default address (noreply@zohoflow.com) to send emails. If a Gmail email address is used, your configured emails will fail to deliver.

Most common scenarios where a Gmail address may be used: 
  1. Super admin/Admin email addresses: If a Gmail address was used during Zoho Flow signup, there's a higher likelihood of those addresses being the sender's address. 
  2. Verified email addresses: In cases where users' verified email addresses are Gmail accounts.

Will I be afffected?
This limitation is specific to when gmail.com and googlemail.com are the sender domain. If you have a custom domain, such as zylker.com, hosted on Google Mailbox, then it will not be impacted by the new sender email limitation. Also, if emails sent from your address via any automation total fewer than 5000 emails per day through Zoho Flow, there should be no cause for concern.

Please note that this limitation is not due to a change in Zoho Flow's send email action. It is due to the policy updates recently rolled out by Google. This policy change does not affect any Gmail for GSuite app triggers or actions.

Email address verification

The Send Email action allows you to send emails through workflows with the From address of your choice (for example, sales@yourdomain.com). As the emails are sent from Zoho Flow's mail servers, you are required to verify the validity of the From email addresses you provided.


Domain verification

Although your email address is verified, emails will still be sent from noreply@zohoflow.com. If you need to send emails from your own domain (to use your own email address in the From address of the Send Email action), then your domain needs to be verified. Domain verification allows you to do this, ensuring that emails are sent from your domain, rather than from noreply@zohoflow.com.


Why domain verification?

Use case

Let’s assume that you built a flow using the Entry Submitted trigger in Zoho Forms, where Email is one of the form fields. Each time a response is submitted, the email address from the form is mapped to the To address in the Send Email action.

Problem
In the use case above, even though your email address is verified, your domain is not, so emails will be sent from noreply@zohoflow.com. Your recipients may assume that these emails are sent from Zoho Flow because of the From email address and click on the malicious links sent via emails.

On the other hand, some customers are aware of malicious links and may mark noreply@zohoflow.com as a spam address. This will prevent legitimate emails from reaching their recipients.

Solution:

For Send Email notifications, you must verify the email address as well as the domain in order to send emails from your own email addresses. Only after the email address and domain are verified will the email address appear in the From dropdown and can be used to send emails from that domain. You can also configure the From field in the action to add a custom email address instead of the default noreply@zohoflow.com.

Step 1: To verify an email address, follow these steps:
  1. Click Add new email address adjacent to the From address field.



  2. Provide the email address that you want to use as the From address in the Email address field and click Verify.

  3. A One-Time Password (OTP) will be sent to the email address provided. Enter it in the verification code field and click Verify to complete the verification.


NotesNote: If you do not complete verification, noreply@zohoflow.com will be used as the default From address


Step 2: To verify a domain, follow these steps:



  1. Sign in to your domain host.

  2. Go to the DNS records page of the domain and locate the option to add TXT records.

  3. Copy the Host name, Domain SPF, and Domain DKIM and paste them in the TXT record.

  4. Once you're done, click Validate.


Once the email address and domain are verified, you can view the domain and email address in the Mail Management section, which can be accessed under the Settings tab.


InfoImportant: Domain verification (using SPF/DKIM) is a one-time process. Once done, it applies across all Zoho apps, powered by the ZeptoMail API.

  • You can view all the verified domains and email addresses on the Mail Management page.

  • To authenticate a domain, click Authenticate. Once it is verified, the status will change to Authenticated.

  • You can delete a domain or email address by clicking the trash icon. The deleted email address and domain will be deleted permanently. You can add them again, if needed.