Forum Discussion

RubyKapil2's avatar
RubyKapil2
Qrew Captain
4 years ago

Contains and IsNull formulas - is "=true" necessary

Are both of these correct and will result in the same outcome? For me they do.
Somewhere I saw the B version with the =true.
I suddenly started wondering about it for some reason - tests fine but wanted to know if there was any best practice regarding Contains.
Same thing for IsNull - does that need =true from a best practice standpoint?

A. If(Contains([TESTFIELD], "Yes"), true, false)

B. If(Contains([TESTFIELD], "Yes")=true, true, false)



------------------------------
Ruby Kapil
rubykapil@wi-finity.com
Wi-Finity, Inc
------------------------------

4 Replies

  • I believe the formula evaluates as true by default Ruby. So both are correct, but B is not necessary.

    Here is a link to  further information on all of the current Quick Base formulas including sample formulas:
    link

    ------------------------------
    Adam Keever
    ------------------------------
    • RubyKapil2's avatar
      RubyKapil2
      Qrew Captain
      Thanks for that confirmation - saves a lot unnecessary typing

      ------------------------------
      Ruby Kapil
      rubykapil@wi-finity.com
      Wi-Finity, Inc
      ------------------------------
  • AustinK's avatar
    AustinK
    Qrew Commander
    You can also do just:

    Contains([TESTFIELD], "Yes")

    Which will work as well. As Adam said it defaults to true. So if TESTFIELD contains "yes" it will be true, if not it is false. You can test that with a formula checkbox. If you need to flip the conditions for whatever reason then you can include the True and False in there too.
    • RubyKapil2's avatar
      RubyKapil2
      Qrew Captain
      Thanks!

      ------------------------------
      Ruby Kapil
      rubykapil@wi-finity.com
      Wi-Finity, Inc
      ------------------------------