With logic jumps, you can create different conversational paths based on conditions on previous user's answers and variables.
Depending on the type of answer you want to use to create a logic jump, you'll have access to certain conditions.
Let's take the example of an animal quiz for kids to illustrate how logic jump works.
Logic jump based on a text answer
Text answer can be an answer to an open answer block, buttons block or picture choice block.
In the quiz, I want to ask the following open answer question: "What is a baby rabbit called?".
I chose an open answer block to make the exercise more difficult compared to a question with already-made answers.
I created two conversational paths: one in case of a good answer and the second in case of a wrong answer, using logic jump block.
Below, you'll find all the conditions you can apply to a text answer.
I chose the "Contains" condition to build my logic jump block.
If this condition is true, my bot will say, "Correct!". If not, the bot will say, "Nice try!".
You can do the same with buttons and picture choice blocks.
You don't need to use logic jump block if you want to create conditions on a buttons block right after the question.
Here is an example:
If you want to add a condition later in the conversation, the logic jump block becomes necessary, like below.
Logic jump based on a numerical answer
A numerical answer is only provided with a number block. If you ask for a number in an open answer block, Joonbot will not take this as a number but as a text.
Below, you'll find all the conditions you can apply to a numerical answer.
In my quiz, I have a question that doesn't require an exact number. I'm looking for an approximation so I don't give any ideas to the kids.
The answer is 30. Here are the rules I want to apply:
- If the kid answers a number greater than or equal to 50, he'll receive a "nice try!".
- If the kid answers a number lower than or equal to 10, he'll also receive a "nice try!".
- In any other cases, the kid receives a "Correct!".
Here are the steps:
Logic jump based on a date answer
A date answer is only provided with a date block. If you ask for a date in an open answer block, Joonbot will not take this as a date but as a text.
Below, you'll find all the conditions you can apply to a date answer.
You even have a date picker to select the date to compare with. 😉
You can set up compiled logic jumps as I did in the previous example.
Logic jump based on a variable
Within the logic jump block, you can choose to create a condition on all questions and variables available.
A variable can be a text or a number. You have the same possibilities as written in the previous "Logic jump based on a numerical answer" and "Logic jump based on a text answer" sections.
However, the hidden fields are missing.
To create a logic jump on a hidden field, you previously need to save the hidden field as a new variable using the "set variable block".
Here is an example.
Usual errors
Logic jump based on a deleted block
Sometimes, you build a logic jump based on a block that you delete afterwards. In that case, the logic jump block is reset. It means there is no condition anymore, and the conversation flow will always follow the "false" case. Check your logic jump blocks and update them before putting the bot on your website or sharing it.
Logic jump based on an edited block
Sometimes, you also build a logic jump block based on a block from which you changed the variable name afterwards. In that case, the logic jump block is reset. There is no condition anymore, and the conversation flow will always follow the "false" case. Check your logic jump blocks and update them before putting the bot on your website or sharing it. We will do an update soon so that the block will not reset in this case.
Happy building!
Comments
0 comments
Please sign in to leave a comment.