When using a field as a Boolean switch, it's desirable to limit the potential for bad data entry - or your own bad coding! This is similar to using a validation on a phone number field, where strict requirements must be met. Because the validation is strictly enforced, this will increase your level of confidence with regards to the contents of Boolean fields.
The following guidelines are suggested for Boolean fields.
- Use a numeric field type
- Prefix the field name with a Boolean word such as is or isNot (e.g. isStudent or isCustomer)
- Specify the field to Always validate (image 1) and turn off "Allow user to override during data entry" (this assumes your users won't be directly interacting with the field and will likely be using a script or some type of trigger)
- Specify a calculated validation similar to the following (image 2)
- Specify a custom message similar to the following (this means if users actually see this message in production, you've done a bad job of coding) (image 3)