I want my recipe to return "true" if the value of my data pill is a string. Is there a formula for this?
Best Answer
P
Patricia Guevarra
said
over 5 years ago
Hello Saul,
There is certainly a formula for this. Please try using .match?(/^\+?\d+$/) after your data pill. Do try this out and let us know if you face any issues.
Answer
Patricia Guevarra
said
over 5 years ago
Hello Saul,
There is certainly a formula for this. Please try using .match?(/^\+?\d+$/) after your data pill. Do try this out and let us know if you face any issues.
R
Ravi Shankar
said
almost 3 years ago
This is not working for me: It is returning false. It should return true because before .match function value is "BER:" which is text.
Patricia Guevarra
said
almost 3 years ago
Hi Ravi,
Sorry, looks like there was some lack of clarity in the previous posts. The given formula checks if the string is an integer, and will return true if the value in the data pill is an integer. Did you instead want to check if there are no digits in the datapill value?
Saul Macht
Check field value if it's an integer
I want my recipe to return "true" if the value of my data pill is a string. Is there a formula for this?
Hello Saul,
There is certainly a formula for this. Please try using .match?(/^\+?\d+$/) after your data pill. Do try this out and let us know if you face any issues.
Patricia Guevarra
Hello Saul,
There is certainly a formula for this. Please try using .match?(/^\+?\d+$/) after your data pill. Do try this out and let us know if you face any issues.
Ravi Shankar
This is not working for me: It is returning false. It should return true because before .match function value is "BER:" which is text.
Patricia Guevarra
Hi Ravi,
Sorry, looks like there was some lack of clarity in the previous posts. The given formula checks if the string is an integer, and will return true if the value in the data pill is an integer. Did you instead want to check if there are no digits in the datapill value?