Sometimes, you might only want a user to go to a particular message if a user has given a particular response. This is what rules are for.
To create a rule, you first have to make a connection. Once you have done this, select the relevant connection by:
- in Flowchart: clicking the gear button that sits on the relevant connection link.
- in List view, clicking on the purple connection text at the top or bottom of the message (in the below image, either the messages called ‘Name’ or ‘Company details’).
A sidebar will appear which allows you to make a rule.
Create a rule
Let’s use an example to talk about the next step.
Say you wanted to collect someone’s personal details, like their name, then you might want to first ask whether they are happy to provide you with those personal details.
The first message might say: “Are you happy to provide us with your personal details?”
And the second message might say: “What is your full name?”
But, you only want the second message to appear if the person responded “Yes” to the first message.
How do you make that happen?
To make this rule, you would need to click Add rule in the purple sidebar and then select the following from the field that appears:
- Message: the name of the message which asked: “Are you happy to provide us with your personal details?”
- Operation: Is
- Response: Yes
Once you are happy with the rule, just click outside of the rules sidebar to return to the conversation flow. The rule will save automatically!
If you have multiple connections coming from a message, you need to apply rules to all connections.
To use the example above, you have to tell the bot where the user goes if they say “No” to: “Are you happy to provide us with your personal details?”
Multiple rules
You can add more than one rule to a connection by clicking “Add rule” again.
This will be helpful if you need a user to have answered multiple questions in particular ways to know whether or not to show them a particular message.
If you do create more than one rule in the same connection, you will need to be aware of how the All/Any toggle works (see below).
It may also be helpful to understand how Groups of rules works.
Types of rules you can apply
The type of rule you can apply sometimes depends on the message type. The following operations are available for the following message types:
- Text: is, is not, contains, not contains, starts with, ends with
- Numbers: is, is not, is greater than, is less than
- Multiple choice: is, is not, contains, not contains
- Multiple choice (pick one or more): is, is not, contains, not contains
Read about the types of rules you can apply based on message types.
Applying the All/Any toggle
The All/Any toggle appears at the top of the rules sidebar.
If you have created more than one rule and you select "any", then if any of those rules are satisfied, it will connect to the connected message.
If you select "all", then all of those responses must be given before it connects to the connected message.
It’s like using “And” or “Or” in a Boolean search when you’re doing legal research.
Read about applying Groups of rules.