Forum Discussion

NicoleCordeiro1's avatar
NicoleCordeiro1
Qrew Cadet
2 years ago

If/then with blank field and checkbox

Hello friends, question about a field that used to work for me but no longer does. 

In one form, one field will either be blank or have a number in it, we'll call it "tag number". If "tag number" is blank, I set up a checkbox to check. If "tag number" is filled out, then the checkbox will not check. 

the formula I used that used to work was

Checkbox-formula

if([tag number]=null, true, false

Am I doing something wrong? The box is not showing checked when I leave the Name field blank. 

When I use 

If(IsNull([tag number]), false, true)

It checks whether it is blank or not

Help



------------------------------
Nicole Cordeiro
------------------------------

  • The correct formula is this. 

    if(Trim([tag number])="", true, false)

    in order to test a text field for blank you check if it's equal to empty quotes.  


    I'd like to wrap it in the trim function just in case someone enters some invisible spaces into the text field. 



    ------------------------------
    Mark Shnier (Your Quickbase Coach)
    mark.shnier@gmail.com
    ------------------------------
    • ChayceDuncan's avatar
      ChayceDuncan
      Qrew Captain

      If Tag Number is actually a Numeric field - you can also user the Nz() function. It will return 0 if the value is entered as 0 or null - basically a way to force it to render as 0 in all cases. You could then do if( Nz([Tag Number]) > 0, true, false)



      ------------------------------
      Chayce Duncan
      ------------------------------
      • NicoleCordeiro1's avatar
        NicoleCordeiro1
        Qrew Cadet

        thank you, everyone! the second option worked, and then I just flipped the true,false to false, true and that worked! thank you both for your help! I'll be able to use the first option I believe with another challenge. Thank you!!!



        ------------------------------
        Nicole Cordeiro
        ------------------------------