AND/OR rule conditions in custom rules

Edited

Overview

Front's rule engine allows you to create rules using AND/OR statements. With this capability, you're able to create complex workflows within a single rule, making it easier to manage moving forward.


How it works

There are three main components when creating a rule:

Trigger (when)

Filter (if) - AND/OR is a feature of the filter component

 Action (then)

A trick to understanding how the filter component works is by thinking about it as building blocks or Legos (our favorite)! When you add a filter condition you can either add that condition to an existing block or create a new block. 

Conditions within the same block are treated with 'Or' logic. We then use 'And' logic between filter blocks.

Looking at the below example, you can see that in order for this rule to be executed the conversation needs to have either tag After Hours OR tag Priority 1 AND be in inbox Support. 


Delayed-rule method to use And/Or conditions

Many customers want to send an Off Hours message template during specific hours throughout the week. With And/Or conditions, you can do this!

Look at the rule below, you'll see that this rule will trigger IF the conversation appears in Jessye's Inbox AND the Day is M-F AND the time is between 12-1pm (lunch break) OR 5pm - 8am (after hours). Both the inbox and day of the week requirement must be met for the rule to trigger, along with one of the specified time periods.


Exclusionary rule conditions

There is a specific structure for setting up a rule to trigger when certain elements are not in the messages. For example, you want to assign all inbound messages to a specific teammate, except for messages containing specific subjects. In this case, you’ll want to use Does not contain rule conditions. For a full list of rule conditions, including exclusionary conditions, see this guide.

In order to use exclusionary rule conditions:

  • Use the AND condition.

  • If you have multiple items you want to exclude using the same condition, use semicolons to separate phrases within the same AND condition. See the examples below.

Let’s say you wanted your teammate Anthony to get assigned all messages except for those with Bluth’s Frozen Banana or Stair Car in the subject line.

You would write a rule that looks like the following:

Now, let’s say you want to get more specific and add an additional condition: Anthony should not be assigned messages that have either the subject Bluth’s Frozen Banana or Stair Car, and the word Illusions in the body of the email. In this case, you would need to add a separate AND condition:

Note: Using the OR condition in tandem with Does not contain will cause the universe to implode (not really, but your rule won’t work. Trust us on this one