The documentation for "contains" isn't too helpful ... the (Hello World,Hello) example doesn't show how to check a field.
I'm trying to see if a field contains the word Anniversary. If true, I'll set a project ID. If not, nada. Right now, I'm just testing and I'm getting nowhere.
I know the field contains Anniversary, but I keep getting a false. Anyone out there know how to do this?
Solved! Go to Solution.
Hi Howard,
Your variable value is so close! But missing a semicolon.
right now your function is something like:
{{if(contains(1.`Some Text Value`; "Anniv") + "Anniv Found"; "Anniv Not Found")}}
but it should be:
{{if(contains(1.`Some Text Value`; "Anniv"); "Anniv Found"; "Anniv Not Found")}}
(you can copy and paste this text and then you can swap out the variable values.
contains works as you would expect, returning a true or false if the value is found in that text. In this situation, the contains was not actually the problem. Instead, your if statement was missing the semicolon after the first expression. As a useful tip in the future, you can strip out the if and test the contains by itself to get more insight.
I should also note that "contains" may work differently if you are dealing with an array. I've attached a simple blueprint you can import anywhere to confirm how it works with both a text and an array. I hope this helps.
Views
Replies
Total Likes
Hi Howard,
Your variable value is so close! But missing a semicolon.
right now your function is something like:
{{if(contains(1.`Some Text Value`; "Anniv") + "Anniv Found"; "Anniv Not Found")}}
but it should be:
{{if(contains(1.`Some Text Value`; "Anniv"); "Anniv Found"; "Anniv Not Found")}}
(you can copy and paste this text and then you can swap out the variable values.
contains works as you would expect, returning a true or false if the value is found in that text. In this situation, the contains was not actually the problem. Instead, your if statement was missing the semicolon after the first expression. As a useful tip in the future, you can strip out the if and test the contains by itself to get more insight.
I should also note that "contains" may work differently if you are dealing with an array. I've attached a simple blueprint you can import anywhere to confirm how it works with both a text and an array. I hope this helps.
Views
Replies
Total Likes
The dreaded SEMI-COLON!
Thank you so much for the help.
Views
Replies
Total Likes