Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Hello,
I want to check if a variable contains a letter. For this I want to use a formula in a prepare recipe
Here my code :
if(arrayContains([A-Z], strval('name_var')),1,2)
Output is always '2' even when there is a letter in the variable i'm checking
Thank you, Olivier
You are right, I forgot the '.*' at the end of the expression.
Happy to help and have a great week! Ignacio
Hi @OlivierAb
My impression from the documentation is that arrayContains doesn't work with regular expressions, which is what you are trying to do apparently.
What might work is this:
if(arrayLen(match(column, ".*([A-Za-z])")) > 0, 1, 2)
where you should replace column with the name of your column of interest.
If I understood your problem wrongly please let me know! Cheers
Thanks a lot Ignacio !
it works with just a little adjustment. Indeed, ".*" is missing
the final working formula is "if(arrayLen(match(column, ".*([A-Za-z]).*")) > 0, 1, 2)"
Thanks again for your reactivity, Olivier
You are right, I forgot the '.*' at the end of the expression.
Happy to help and have a great week! Ignacio