Skip to main content
All CollectionsAutomation Platform
AND / OR logic in filters
AND / OR logic in filters

Learn how to setup conditional logic in filters in automation builder!

Mihir Lodhavia avatar
Written by Mihir Lodhavia
Updated over 9 months ago

Using And / Or logic in filters is the best way to ensure only relevant flows proceed to following action steps in a Workflow.

To setup a filter step, a successful test of the trigger is necessary. Once that is complete, here's how you can setup a filter:

  1. Select Filter as the next step.

  2. Filter Templates are pre-set filters which are most requested in the builder. Click on 'Select a filter template'.

If a template does not exist for what you are trying to achieve, click on Advanced filters. For this article, we need to select Advanced filters.


This brings us to the filter step, which looks something like this:


Here's a brief explanation of how AND and OR logic work in the Filter step:

  1. AND Logic:

    • When using AND logic, all specified conditions must be met for the filter to pass.

    • For example, if you set up two conditions using AND logic:

      • Condition 1: Email contains "@example.com"

      • Condition 2: Email has attachments

    • The filter will only pass if both conditions are true. So, an email with the address "@example.com" and the email has attachments would pass the filter.

  2. OR Logic:

    • When using OR logic, the filter will pass if any of the specified conditions are met.

    • For example, if you set up two conditions using OR logic:

      • Condition 1: Email contains "@example.com"

      • Condition 2: Email has attachments

    • The filter will pass if either condition 1 or condition 2 is true. So, an email with the address "@example.com" or the having attachments (or both) would pass the filter.

  3. AND & OR combined
    โ€‹

    1. Using AND and OR together:

      • You can create groups of conditions using parentheses to specify the order of operations, similar to how you would in a mathematical expression.

      • For example, consider the following conditions:

        • Condition 1: (Email contains "@example.com")

        • Condition 2: (Email has attachments AND it is not an incoming email)

      • This filter will pass if the email address contains "@example.com" OR either the subject contains "Important" AND the subject contains "Urgent".


        โ€‹

    By using AND, OR, and parentheses to group conditions, you can create highly specific filtering rules to match your workflow requirements in our Automation Builder. This flexibility allows you to handle a wide range of scenarios and trigger actions only when certain criteria are met.

Did this answer your question?