If you’re an experienced marketing automation user, or even if you are just looking to get into automation, you’ll find yourself very quickly needing to get your head around conditional logic.
Simply put, conditional logic is a system of rules that can be expressed as an “If this, then that” statement. The condition (the “this” part), dictates the response statement (the “that” part).
Conditional logic is everywhere around you. It’s the rules by which we live our lives.
If it’s cold, then put on a jumper
If you’re hungry, then eat something
If you’re tired, then go to bed
Conditional logic is also the foundation behind pretty much every marketing automation journey that’s ever been built.
But before we get ahead of ourselves, let’s apply some of the nuances that exist in conditional logic to our every day examples above before we focus in on how conditional logic is applied to marketing automation.
1. The OR condition
An OR condition is inclusive. It allows you to cast your net wider.
In our last example, we could add an OR condition like this:
If you’re tired OR it’s late, then go to bed
This rule will now be applied in either scenario. So even if you’re not tired, if it’s late, you’ll still go to bed. Flipping that, it could be 3 O’clock in the afternoon, but you’re tired, so off to bed you go (wouldn’t that be nice?)
2. The AND condition
AND‘s are the opposite of OR‘s. An AND condition is exclusive. It helps you to narrow your rule criteria.
Again, using our bed example, we could add an AND condition like this:
If you’re tired AND it’s late, then go to bed.
This rule will now only be applied if you’re tired, AND it’s late, so no early naps for you!
AND conditions can sometimes feel a little counterintuitive, as we’re so used to thinking of an and as something that gets you more stuff “I want that and that!”, but when applied to conditional logic, the opposite is true, so it’s an important distinction to get your head around.
3. The NOT condition
A NOT condition is a really powerful thing. It completely turns the first part of your ‘If This, Then That’ statement on its head.
Again, when applied to our bed example, it’s pretty clear how this works
If you’re NOT tired, then go to bed.
Now, whilst that particular NOT will result in a rather pleasant duvet day for most people, and not much more, the repercussions of a poorly placed NOT in your digital marketing efforts can often be far more dramatic.
Imagine you had a database of 10,000 contacts, and wrote a rule stipulating that:
If a contact lives in London, then send them a piece of direct mail
Fine, that works, and you’ve successfully sent the 1,000 contacts that live in London a postcard!
But let’s now introduce a careless NOT…
If contact NOT lives in London, then send them a piece of direct mail.
Okay, so whilst this statement might read a little bit funny, the impact should still be clear.
This command will send a postcard to everyone that doesn’t live in London. I.e. Your remaining 9,000 contacts!
This might prove to be an expensive exercise if some of your contacts live in Australia!
Moral of this story? Treat NOT‘s with respect!
Now we’ve got our heads around how rules can be nuanced in the first half of our ‘If This, Then That’ rules, it’s time to look at the second half.
4. The ELSE statement (and time restrictions)
The ELSE statement can also be thought of as “otherwise”, and again, like a NOT condition, it’s something to be treated with due care.
An ELSE statement gives you an alternative response, also known as a branch (or if you’re using Zapier, a path), because it branches off into a different, distinct direction.
Extending our previous example, you can see how a well placed ELSE statement can prove really helpful.
If contact lives in London, then send them a piece of direct mail, ELSE send them an email.
This ELSE statement will save you a small fortune on stamps!
When it comes to real time triggers, it’s pretty common for an ELSE statement to be applied in conjunction with a time based condition.
To illustrate this, let’s use a nightclub metaphor.
A simple ‘If This, Then That’ + ELSE statement might read something like “If I got to a club and am allowed straight in, I will enter the club ELSE I will go to a different club“
Whilst logically, that sentence makes perfect sense, practically, it’s pretty impatient. Have you ever been to a good club where you didn’t have to queue for at least a few minutes?
Here’s where that time conditions comes in handy.
“If I got to a club and am allowed straight in, I will enter the club ELSE I will wait up to 15 minutes then I will go to a different club“
As you can see, the time constraint gives us the ability to be a lot more flexible with our rules. You will normally find 4 variations of a time constraint in conditional logic
- Do not wait. This is akin to our impatient clubber.
- Wait forever. This clubber is happy to wait forever to be let in. How sad!
- Wait N seconds/minutes/hours/days etc. In our example above, our clubber was willing to wait 15 minutes before moving down the ELSE branch (going to a different club)
- Wait until N time/date. Rather than waiting 15 minutes, our clubber might only be willing to wait until 8pm (for example), before moving down the ELSE branch.
Nothing do do with birds, a nested condition is a condition that sits (nests) within another branch. Conditions can be nested an unlimited number of times to build out advanced logic that deals with almost any eventuality.
Whilst steps can be nested within branches, conditions can also be nested within each other. For example, you can nest OR conditions within an AND condition. I.e. You want to speak to people with red hair that are wearing either blue OR green shirts.
In this case, the shirt colour criteria is nested within the hair colour criteria. If the subject doesn’t have red hair, it doesn’t matter what their shirt colour is, they will still be excluded from this filter (click here for a visual example of conditional nesting).
So, how does conditional logic apply to marketing automation?
So, finally, we get to the point of this whole article. How does all this relate to marketing automation?
I hate to say it, but marketing automation’s nowhere near as smart as we like to make out. Just like the rest of us, it needs clear rules to follow in order to build your automations, and it uses conditional logic to achieve this.
Whilst every interface will look and feel different, ultimately, the rules that are being applied are the same.
In the case of something like Zapier, the rules are applied through the creation of triggers (the If This part), and actions (the Then That part)
Zapier’s brilliant (read our top 5 advanced Zapier tricks here), but you can take their relatively simple rule builder to the next level with the addition of a drag and drop workflow builder such as our own Journey planner.
Here you can see how advanced rules can be quickly and easily created simply by dragging conditions and steps from right to left…
In fact, you can find conditional logic liberally sprinkled all over Kulea. Here’s an example where we’ve applied it to our CRM data to create a custom filter. Note how the OR conditions are nested within the AND conditions.
If this filter were to be translated into a sentence, it would read as “Include all directors, except those with finance in their job title, that are based in England, Ireland, Scotland or Wales“.
And that, dear reader, is our final piece of advice on the subject of conditional logic.
If you’re struggling with how to build your conditions, whether they be through a rules based system like Zapier, or a visual builder like Kulea, then simply write down what you’re trying to achieve and try and translate it into conditional logic.
And here’s a really handy video on the subject over on YouTube for those looking to delve a little deeper. Enjoy 🙂
Sign up for great digital marketing content!
Join our mailing list to receive the latest insights, news and updates from our team. ( We do not share your personal data )