cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

A Condition block allows to steer the flow based "if, then" logic statements. The Condition block checks variables and guides the user in different places of the conversation based on it.

 

🎥You prefer to watch a quick hands-on tutorial? Check out our new bot builder video tutorial!

 

To add a Condition block to your flow:

  1. Drag and drop a Condition block from the side panel onto the canvas.
  2. Click the + button.
  3. In the previous flow, we used a Collect input block to ask the customer how many pizzas they want to order, and we saved their response in the variable 'order_amount'. In this case, choose the variable 'order_amount' under the If condition. This selected variable will represent the amount of pizzas ordered. If a customer orders more than five pizzas, they will be automatically redirected to a special conversation where they can claim a complimentary pizza. 
Condition (3) (2).gif

4. Next, select greater than and enter 5 in the next input field. This is because we will be offering free pizza for orders greater than 5.

 

Screenshot_2023-11-24_at_14.10.02.png

5. If the user's response meets this statement, the conversation will go to a special block called 'Claim Free Pizza'. To make this happen, you can set up a Go To. You can either pick an existing bot dialog or make a new one. Since we don't have a block named 'Claim One Free Pizza' yet, we'll make a new one.

 

Screenshot 2023-11-24 at 14.15.37.png

 5. The Else statement is executed when none of the other paths are applicable. You have the flexibility to decide what action should be taken when none of the conditions are met. In this case, if the customer's orders are not more than five, the Else section will redirect them to the purchase flow.

 

Screenshot 2023-11-24 at 14.16.42.png

6. Next, click on Create and add a message to the 'Claim free pizza' block and the 'purchase flow'.

 

Screenshot 2023-11-24 at 14.21.01.png

7. Test the result to see how your changes perform. 

 

Screenshot 2023-11-24 at 14.23.35.png

 

See also: 

[New bot builder] Save a variable based on button click

[New bot builder] Collect input from your users

[New bot builder] Make a channel router flow

Version history
Last update:
‎01-02-2024 04:25 AM
Updated by: