3 Replies
i trying to make this easy fluxogram
but how i can verify the Error variable?
i need to created a loop if no received correct number
What's the question?
Some things I see you could do better:
- There's no point in using the
setVariable()
function inside the Set variable
block. Anything you put as the value of the block will already be the value of the variable you're defining. So just put "0" in the Set variable
block. Though, you're defining ErrorFirstSelectMenu
as 0 but never using it in your flow, so I'm wondering why it exists in the first place 🤔
- Now I see you're using a switch condition when it's definitely not needed. Why? Because you basically only are appending the user-inputted number to a fixed string Você escolheu a opção
if the number is between 1 and 5, otherwise you want to do something else.
Another thing that proves that you don't even have to do this is that you can set a "Min" and "Max" value in the Number
Input block, meaning that your users could not even input a number value that is outside of that range. So I'd advise you just put 1 as the Min and 5 as the Max, so you won't even have to have a complex "Error" check.
In the image below, I made your flow a 3-block flow with no conditional check needed, and using inline code to append the user-inputted number to Você escolheu a opção
.
Put this code inside a regular Text
Bubble:
Hope it helps!
