Quick Base Discussions

Expand all | Collapse all

Checkbox Formula - field does not contain text

  • 1.  Checkbox Formula - field does not contain text

    Posted 09-27-2017 20:44

    working with "Contains".
    Example: If(Contains(ToText([Approvals Needed:]),"Quality Assurance") and Contains([Approvals Logged],"Quality Assurance"),true)

    However, I cannot figure out how to change it to work from the condition that the field "does not contain" something.
    Example using "excludes" as the opposite: If(Exludes(ToText([Approvals Needed:]),"Sales"),true)

    I do not know how to write this where not having certain text included in the field is the condition. Any help?

    Thank you~




  • 2.  RE: Checkbox Formula - field does not contain text

    Posted 09-27-2017 20:54
    you can do this

    If(not Contains(ToText([Approvals Needed:]),"Sales"),true)

    The not just reverses the result form True to false or false to true.

    But  for a Boolean result, you don't need the IF

    For example, your original 

     If(Contains(ToText([Approvals Needed:]),"Quality Assurance") and Contains([Approvals Logged],"Quality Assurance"),true)

    could also be written


    Contains(ToText([Approvals Needed:]),"Quality Assurance")
     and
    Contains([Approvals Logged],"Quality Assurance")

    just easier to read 

    That is basically a statement you are making and QuickBase decides if you are telling the truth and return true or else calls you a liar and returns false.

    So on your second test

    not Contains(ToText([Approvals Needed:]),"Sales")

    will be true if the approvals do not need sales approval.





  • 3.  RE: Checkbox Formula - field does not contain text

    Posted 09-28-2017 14:17

    Thank you for giving me what I needed. This is a formula that I ended up with, and it seems to be working:

    If(not Contains(ToText([Approvals Needed:]),"Sales") or
    (Contains(ToText([Approvals Needed:]),"Sales") and Contains([Approvals Logged],"Sales"))
    ,true)



  • 4.  RE: Checkbox Formula - field does not contain text

    Silver
    Contributor
    Posted 09-27-2017 20:56

    Since the function Contains is Boolean, check for a true condition anyway, then do the opposite of what you'd do if the [Approvals Needed:] contained "Sales".

    if(contains(totext([Approvals Needed:]), "Sales", false,true)

    Just turn around the true,false and make it instead false, true.



  • 5.  RE: Checkbox Formula - field does not contain text

    Posted 09-28-2017 14:19
    Thanks for the idea.