https://discord.gg/botpress logo
Single choice behavior
# 🤝help
s
I'm testing my bot's new subflow, and when I reach a single-choice card, the bot either jumps to a different subflow or restarts the conversation. It never proceeds to the next module. I'm getting the following message: Transitioned - Main:subflujo_vale_compra or the conversation just restarts. How can I prevent this behavior?
f
Hi! I can help you figure out why your single-choice card is jumping subflows or restarting the conversation. This usually happens if the transitions aren’t set up correctly. Can you show how your transitions are configured for that card? @some-king-77888
s
The transition labels are the same as their conditions. I've been testing by removing cards one by one to see which one was causing the error, and the flow only worked correctly when I removed the single-choice card. https://cdn.discordapp.com/attachments/1417095039900717188/1417106883566899331/image.png?ex=68c94721&is=68c7f5a1&hm=9166807e0592ea322aebfeb75e44898827a26e61ebe3b770d08a7cc0b4e73bbb&
g
are you talking about in standard3 node?
if the conversation ends when you check that .length > 1, === 1, and === 0 then none of those are met and the conversation ends due to the transition at the bottom not being connected to anything
however from looking at your expression, i believe it may be because your using "==" not the true js equality check which should be 3 equals signs: "==="
if that still doesnt fix it maybe you have an object instead of an array? are you doing the length check on workflow.varName.length or just varName.length