Discussions

 View Only
  • 1.  Contains and IsNull formulas - is "=true" necessary

    Posted 06-16-2020 08:56
    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
    ------------------------------


  • 2.  RE: Contains and IsNull formulas - is "=true" necessary

    Posted 06-16-2020 09:20
    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
    ------------------------------



  • 3.  RE: Contains and IsNull formulas - is "=true" necessary

    Posted 06-16-2020 09:29
    Thanks for that confirmation - saves a lot unnecessary typing

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



  • 4.  RE: Contains and IsNull formulas - is "=true" necessary

    Posted 06-16-2020 10:06
    Edited by Austin K 06-16-2020 10:07
    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.


  • 5.  RE: Contains and IsNull formulas - is "=true" necessary

    Posted 06-16-2020 15:38
    Thanks!

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