#How can i check a variable without case sensitivity?

1 messages · Page 1 of 1 (latest)

granite parcel
#

Right now I use a condition element:
variable Contains string
OR
variable Contains String

How can I make this more elegant?
I tried to use regex /^string$/i but this does not seem to work.

#

How can i check a variable without case sensitivity?

tame wave
#

Maybe converting to uppercase or lowercase before to compare

granite parcel
#

I'll try that. It would require to work with the script module. Which is kind of hard for someone like me. But I'll give it a shot. Thanks.

rocky blade
#

The regex should work!

#

Can you provide a reproduction?

granite parcel
#

I tried to do it like this. But it did not work. I managed to write a javascript though with a different approach that works fine.

#

var checkExit = {{user-message-openai}}.toLowerCase();

if(['exit', 'quit', 'menu', 'home', 'back', 'ragequit'].includes(checkExit)) {
setVariable('user-message-openai', 'exit')
}

#

This script checks regardless of capital or lowercase letters if someone entered Exit, exit EXIT...

river mango
river mango
rocky blade
#

If you have a use case that does not work, provide a reproduction so that I can check if there is a bug on Typebot's side 🙂

river mango
granite parcel
cloud wadi
#

ok

rocky blade
#

Should be fixed in 10 min

river mango
rocky blade
#

That works on my end

#

This regex matches only if user_answer is specifically: "callback"

river mango
#

So "Callback" won't work? How do I make it case insensitive?

rocky blade
#

/^callback$/i

river mango
#

Hmmm

#

Like this?

#

Doesn't work for me still.

rocky blade
#

It works when typing callback or Callback