Conditions
Creating dynamic flows can be done in multiple ways the easiest one of them is using conditions. With conditions you can design if / else statements without the need of writing code.
What can conditions be used for?
Conditions open up a wide range of possibilities to dynamically branch or redirect flows. Some examples:
- Show a different response if a handover takes place outside business hours
- Send a user into an on-boarding flow if a certain piece of data is missing
- Give a personalised reply whenever a certain tag exists
How do Conditions work
You can drag and drop conditions below any trigger or reply action. Conditions work fairly similar to branches. Like branches you can add multiple Conditions, re-order or individually remove them.
Below any Condition you can add any number of reply actions and follow up triggers.
Matching
Conditions are validated in run-time. In other words, each time a Condition is matched, the system will dynamically determine if the Condition is valid or not based on its rules.
The order of Conditions is important. If you create multiple branched Conditions for example, A, B, C, the system would first try to match A, next B and finally C.
This also means that the first Condition that is valid will be the winner and any other Condition on the same level, even if the rules match, is ignored.
Any Condition can have multiple rules. By default a Condition won’t have any, you’ll need to add them manually. A rule-less Condition is always considered valid.
If a Condition has more than 1 rule, you can choose if the Condition should match all rules or if meeting any rule is sufficient for the Condition to be valid.
Rules
There are different type of rules you can select.
Param
Validate params that the NLP engine extracted or were created somewhere along the way. Using this rule you can check if a param exists, contains a certain value or matches a custom entity type.
Channel
With these type of rules you can match if the conversation is taking place on a certain type or specific channel.
Tag
Tags can be added and removed throughout the system. With these rules you can validate if a tags exists, has existed or contains a certain value.
User
Besides tags, you can use this rule to validate certain user profile data like name, language and profile picture.
Business hours
When you configure business hours you can use this rule to determine if the business is open or closed.
AB Testing
Choose AB test to differentiate a response. Note that AB tests only work in combination with other AB test conditions. The division is random. So when you add 2 AB test conditions, either A or B has a 50% chance to get matched.