Logic is a decision point in the chatbot conversation. Unlike a passage, logic doesn't send any content to the user: instead, it checks the current values of variables, constants, or entities against conditions you define, and either runs a script, or directs the conversation to another passage (or another logic) accordingly.
Logic consists of:
- A Name: a short title that describes the decision in the conversation.
-
One or more tabs. Each tab represents an option logic could choose. A tab has:
- A tab Name: a short description of the tab.
- An If section: the set of conditions to check, such as whether a variable matches a specific value.
- A Then section: the script to run or passage to direct the conversation to if those conditions are met, and any actions to perform.
- An Else section: the script to run or passage to direct the conversation to if none of the tabs' conditions are met, and any actions to perform.
- Inbound Questions.
Each tab (and the Else section) is a possible outcome of the logic. If you need three possible outcomes, your logic needs two tabs (the third outcome is handled by the Else section). If you need only two possible outcomes, your logic needs one tab and the Else section. If you create more than three tabs, the additional tabs are displayed in a drop-down list.
Like passages, logic can perform actions when the chatbot conversation reaches the logic, and also has review notes and a review state.
When the conversation flow reaches logic, the tabs are evaluated from left to right. In each tab:
- The chatbot checks the conditions in the If section of the tab.
- If the conditions are met, the chatbot follows the instructions in the Then section of that tab.
- If the conditions are not met, the chatbot moves to the next tab.
- If there are no tabs left to check, the chatbot follows the instructions in the Else section.
To prevent your chatbot users getting stuck in conversation loops from logic errors, logic always retains the previous conversation context. This setting can't be removed from logic.
Order your tabs carefully
The chatbot only performs one set of instructions from logic. Logic tabs are checked in order from left to right. If your logic has more than three tabs, the first three tabs are checked from left to right, then the remaining tabs in the drop-down list are checked from top to bottom. Once a tab's conditions match, the chatbot performs those instructions and does not check the rest of the tabs. If the conditions in more than one tab may match in a conversation, make sure the tabs are ordered by priority from left to right.
Like passage-level actions, logic-level actions are triggered after conversation-level actions, but before the chatbot checks the conditions in the tabs. Actions in the Then section or Else section are performed after the conditions have been checked, but before the chatbot runs the designated script or directs the conversation to the next passage or logic.
For a tutorial on using logic to direct a conversation, see Direct a conversation flow with logic.
Review states
You can see whether logic is in draft, under review, ready for publishing or published by the icon next to the logic name, as well as who last edited the logic, and when.
You can also:
Comments
Article is closed for comments.