Conditional Logic allows you to hyper-personalize your final User Experience. Make sure a field exists or equals something specific and bring contextualized experiences to your visitors!
To create a Conditional Logic block, click on Power-Ups and then Conditional Logic inside the chatbot builder:
Then, select if you want to split the flow depending on the existence (...is set...) of a field, the fact that it's equal (...equals...) to something or that the visitor's message containing a specific keyword ("the last user answer contains"). For the first two conditions, select any of the fields in the first drop-down. For keyword trigger, select "The last user answer".
In this example we'll split the path as follows: if the field @email equals (=) email@example.com - aka some important pal at Alphabet - we'll ask about Google. If not, we'll just ask the name:
The green line is followed when the field (email) does equal firstname.lastname@example.org. If there's no coincidence, landbot will follow the red line!
In this other example, we ask users an open question and will lead them to different blocks if their response contains the keyword "pricing":
If the visitor's answer to the previous Ask a question block contains the word "pricing", the flow will continue the green line. If it doesn't, the red will be followed.
Finally, remember that:
- "=" means equal to;
- "!=" means not equal to;
- "contains" checks for the presence of a determinate value in a variable;
- "Is set" means that a certain variable "exists" for a determinate customer.