PatternCount() might give you what you want.
if you have checkboxes for Red Green Blue and Yellow attached to a field called Color then PatternCount ( Color ; "Red") = 1
You can then use that test in a branching statement like If ( test ) do this ; do that
Patterncount can sometimes produce a false positive result such as finding "agree" when disagree was the actual value.
Not Isempty ( FilterValues ( "Value" ; checkboxfield ) )
will return True if "Value" is selected while avoiding issues with partial matches.
Thanks, almost. ; )
if i have checkboxes for:
Green Tree pencil,
attached to a field called Color then i only want an action if there is the word pencil in it...
You could create a new calculation field with the following:
Case ( PatternCount ( CheckBoxSelection ; "pencil" ) ; "Found" ; "" )
NOTE: checkBoxSelection is the name of your check box field that has the values. You can then set a script trigger for the new field to perform whatever action you'd like.
of course "pencil" as such might fail, but testing for " pencil¶" is more solid.
1 of 1 people found this helpful
@breezer seems to give you a good way to deal with ("take an action") by stating that you can run a script. @breezer is suggesting that checking the box could trigger a script to do your action. But do you need help with the script? What action do you need to perform? For a script triggered by checking the box you could use @breezer calculation like so:
@philmodjunk makes a great point to watch out for with PatternCount... and I like @siplus saftey.
There are indeed ways to make patterncount work.
won't match if Pencil is in the last value of the list as there would then be no trailing return.
Patterncount ( checkboxField & ¶ ; "pencil¶" )
might be an option.
Cool! When is PatternCount OK to be used? Or should I start a new discussion? Thanks
Pattern count is ok to use when it produces 100% acceptable results for all cases of the data.
If you use your list and someone selects Yellow marker then Blue maker then Blue pencil your field will contain
Yellow marker¶Blue marker¶Blue pencil
in that exact order.
PatternCount ( field ; "pencil" ) = 1
and PatternCount ( field ; "pencil¶" ) = 0
Thank you guys!! It turns out great!!
I've a supplement.
There are more questions with checkboxes.
Is it possible to use the self function?
Case ( PatternCount ( Self ; "pencil" ) ; "Found" ; "" ) is not working.
Maybe you guys know a solution.
Otherwise i have to make a 100 scripts voor de same function.
What you wrote should work. Is this an auto-enter calculation? A calculation field? Conditional format expression? How does it not work?
It's a text field. The message is: This function can not be used in this expression