Switch case using numbers

I'm trying to set a value using select step.
Which I'll insert on a table

But somehow when the case is a number, the action is not executed..

For example:
In this case, I use one, then set value correct
image
image

That seems to be ok..


Now doing the same but using 1 instead of one

image
image
Set value valor is not setted
Should it work this way considering it's a number? Or this is a bug?

I think I know the problem, what happens if you use the toNumber formatter on the $_GET variable?

Wether this is a bug or not I don't know...

1 Like

Hello @Apple Yes, using .toNumber() solves the thing, forgot to mention that, but asking if it's strictly necessary :slight_smile:

From your screenshot you can see your get value is a string "1" and not a number 1 so you need to use toNumber.

1 Like

Sorry, was overthinking few things, had one of those days :melting_face:
Thanks both..

@patrick Maybe it is a PHP thing as this is not working. .toNumber() converts it to 1.0 as a double. Case value is 1 as an integer. Select does a strict comparison so no match.