Discussions

Expand all | Collapse all

test for string checkbox

  • 1.  test for string checkbox

    Posted 05-11-2018 17:13
    If([Accounting Solution]=Left("QB Online", 9), true)

    Why doesn't this formula check the box in a Formula Checkbox field?  [Accounting Solution] is multiple choice text field containing entries such as:  QB Online Essentials, QB Online Plus, etc.


  • 2.  RE: test for string checkbox

    Posted 05-11-2018 17:26

    YOu have not finished the formula:

    If([Accounting Solution]=Left("QB Online", 9),true,false)



  • 3.  RE: test for string checkbox

    Posted 05-11-2018 17:27
    If you want the box to be checked if the value in the Accounting Solution field is "QB Online", this should work:
    If([Accounting Solution]="QB Online", true)


  • 4.  RE: test for string checkbox

    Posted 05-11-2018 17:28

    if(

    left([Accounting Solution],9)="QB Online",true,false)

    Right, you probably don't need the 9.



  • 5.  RE: test for string checkbox

    Posted 05-11-2018 17:33
    You probably don't need the If(). Try this:

    [Accounting Solution] = "QB Online"


  • 6.  RE: test for string checkbox

    Posted 05-11-2018 17:34
    That's what I was going to suggest but it's not intuitive.


  • 7.  RE: test for string checkbox

    Posted 05-11-2018 17:36
    This just blew my mind a little. I did not know you could omit the If().


  • 8.  RE: test for string checkbox

    Posted 05-11-2018 17:48
    QuickBase's formula language is an almost pure functional language where every valid formula returns a consistent value. The only exception to purity are those formulas that use the functions Today() or Now().

    The equals operator (ie "=") just compares two values of the same type and returns a Boolean value so there is no need for an If() function.


  • 9.  RE: test for string checkbox

    Posted 05-12-2018 13:28
    Contains([Accounting Solution],"QB Online") 

    suggested by Kevin Martens also works.  Thanks for this discussion.  Very helpful!