Comment on page
Condition block
The idea of a Condition block is a command a block to go to another block immediately.

What a Go-to looks like in your chatbot conversation.
You can create Go-to's from many places in your conversation, which makes sense since it's a nice way to keep the conversation nice and flowing. It might be confusing at first sight but using Go-to's is actually very simple.
There are 2 main ways of creating Go-to's in Chatlayer:
You can go to any block type to any other block type in your conversation.
When you create a Bot Message, you can redirect the user to another block by clicking something. A clicking action can happen with:

Go to another block from a button within a Bot Message
At the end of any block type (be it a Bot Message, Input Validation, Action, or even Go To), you can choose to redirect the user to any other block.
To do that, find the Go To ribbon at the bottom of your block and expand it to fill it in.

Go to any other block by filling in the Go to section at the bottom of your block type.
At the end of Bot Messages and Action blocks, you have the option to transfer the user to another block, and pass a variable that's saved in the user session.
To pass a variable, click on
+Add Variable
and define your variable name and value.
Link two blocks and pass a variable by using the Go to section at the end of a Bot Message or Action block.
Go To bot blocks themselves enable your bot to redirect the user to another block depending on the conditions of the session variables. This is the easiest way of introducing simple if-then logic to your bot.
By enabling the "Case sensitive" toggle capitalization of letters is taken into account when comparing the value of a variable.

In this case the user will be redirected to "first class" if the class variable equals "first". Otherwise, the user will go to the "other class" bot block
The order of the conditional items determines their priority. If a conditional item is met, other conditional items will not be taken into account.
Last modified 1mo ago