Default value for boolean list field can not be set to false

LabKey Support Forum
Default value for boolean list field can not be set to false eva pujadas  2018-11-12 05:12
Status: Closed
 

Dear LabKey,

We are running LabKey 18.2.
We have observed that it is not possible to set a boolean type field to default value "false" through the "Edit Design" menu.

To reproduce this bug:

  • from a list click "Design"
  • "Edit design"
  • Select the "Boolean" type field and go the the "Advanced" tab
  • In "Default Value" select "SET VALUE"
  • Enable the checkbox for the boolean field and save
    As a result the default value for this boolean field will be set to "true", instead of "[none]", as expected.

But, if you want to have a default value "false", repeating the steps and setting it to "false" will not work, it will permanently stay to default value "true".

Thanks for your support,
Eva

 
 
Jon (LabKey DevOps) responded:  2018-11-27 10:38
Hi Eva,

I'll have this looked into, but in the meantime, I would recommend that if you do not have really any other default values being used, you can use the "Clear Defaults" button to remove that option instead. Keep in mind, this will clear the defaults of all the fields for that specific list, so only use it if you don't have too many to input back in or you really need to clear that defaulted boolean setting and are willing to re-input in all your field defaults.

Regards,

Jon
 
Jon (LabKey DevOps) responded:  2018-11-27 10:51
Additional workaround: You can also clear the checkbox and have the changes save for the defaults by editing an additional field's default in conjunction with it.

For example:

If I have a list with the text field called "Full Name" and a boolean checkbox for another field that I originally set as TRUE, I can clear the checkbox AND also update the other field's default, essentially doing two changes, then click Save Defaults.

The end result is that the checkbox says cleared and the default value becomes "NONE" for the boolean value and the field called "Full Name" has a new default set for it. After you do this, you can re-edit that other field to put things back.

Additionally, it appears that if you try to use the Save Defaults option by clearing all of the fields, it doesn't allow you to clear it. This might actually be by design, forcing you to have to use the Clear Defaults button.

I'll get this checked as well.

Regards,

Jon