> ## Documentation Index
> Fetch the complete documentation index at: https://docs.attio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Checkbox

> Modelling boolean values

Checkbox attributes are used to represent boolean values (`true` and `false`). In the UI, they are presented to users as a checkbox, hence the name.

There are no predefined checkbox attributes on any of the standard objects. As a result, checkbox attributes will only be present when added by the user.

Checkbox attributes may only be single-select.

### Reading values

If the checkbox is checked, you'll get the `true` property back, otherwise it will be `false`. This attribute does not support null values.

<CodeGroup>
  ```jsonc Example: a checked attribute theme={"system"}
  {
    "active_from": "2023-04-03T15:21:06.447000000Z",
    "active_until": null,
    "created_by_actor": {
      /*...*/
    },
    "attribute_type": "checkbox",
    "value": true
  }
  ```
</CodeGroup>

### Writing values

To write checkbox attribute values, you can use either the boolean values `true`/`false` or their string equivalents `"true"`/`"false"`.

We support setting these values directly as raw booleans/strings, or by using an object with a single key, `value`.

We only support single-select checkbox attributes, so you may always write checkbox values without wrapping the values in an array (array values containing a single element are also supported).

<CodeGroup>
  ```json Using boolean theme={"system"}
  {
    "a_custom_checkbox_attribute": true
  }
  ```

  ```json Using string theme={"system"}
  {
    "a_custom_checkbox_attribute": "true"
  }
  ```

  ```json Using array theme={"system"}
  {
    "a_custom_checkbox_attribute": [true]
  }
  ```

  ```json Using object theme={"system"}
  {
    "a_custom_checkbox_attribute": [
      {
        "value": true
      }
    ]
  }
  ```
</CodeGroup>

### Filtering

Checkbox attribute values can be filtered by true/false. If using explicit operators, only the `$eq` operator is supported. For example:

<CodeGroup>
  ```json Records where checkbox is checked theme={"system"}
  {
    "filter": {
      "a_custom_checkbox_attribute": true
    }
  }
  ```

  ```json Expanded format theme={"system"}
  {
    "filter": {
      "a_custom_checkbox_attribute": {
        "value": {
          "$eq": false
        }
      }
    }
  }
  ```
</CodeGroup>
