Subject: How to increment and evaluate incorrect answers globally in Typebot?
Hello everyone, đź‘‹
I’m currently building a flow in Typebot and have a specific use case I need help with:
In several steps of my chatbot, users are given multiple-choice questions. Each question typically includes one correct and two incorrect answers. What I would like to achieve is the following:
I start with a variable (e.g. wrong_answer) set to 0.
Every time a user selects an incorrect answer, the variable should increase by 1.
If the user gives three incorrect answers anywhere in the flow, they should automatically be redirected to a specific fallback block (e.g. “Not eligible” or “Please try again later”).
So far, I’ve tried using Set variable blocks with {{wrong_answer + 1}}, followed by conditional checks using wrong_answer >= 3, but it doesn’t seem to work as expected. I’ve also explored Script blocks with JavaScript logic, but encountered issues like "variable is not defined" or the variable not persisting correctly across the flow.
Can anyone provide a reliable method or a working example for counting wrong answers across a full Typebot flow and triggering a redirect after three mistakes?
Thank you in advance for your support! 🙏
0 Replies