Skip to main content
The bool field stores a single true/false boolean value. It’s the simplest field type in PocketBase and is commonly used for flags, toggles, and yes/no options.

Configuration options

bool
default:"false"
When true, requires the field value to always be true. This is useful for acceptance checkboxes or required confirmations.

Validation rules

The bool field validates:
  • Type: Value must be a boolean (true or false)
  • Required: If enabled, value must be true
When required is true, the field will only accept true as a valid value. This is particularly useful for terms of service acceptance or similar use cases.

Go examples

Database column type

API usage

When working with the PocketBase API, boolean fields accept various truthy/falsy values:

Best practices

  • Use descriptive names that clearly indicate the boolean nature (e.g., isActive, hasAccess, enabled)
  • Consider using required: true for critical acknowledgments like terms of service
  • Default value is always false, so plan your logic accordingly
  • For tri-state logic (yes/no/unknown), consider using a select field instead

Zero value

The zero value for bool fields is false.