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.

{
  "active_from": "2023-04-03T15:21:06.447000000Z",
  "active_until": null,
  "created_by_actor": {...},
  "attribute_type": "checkbox",
  "value": true
}

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).

{
  "a_custom_checkbox_attribute": true
}
{
  "a_custom_checkbox_attribute": "true"
}
{
  "a_custom_checkbox_attribute": [true]
}
{
  "a_custom_checkbox_attribute": [
    {
      "value": true
    }
  ]
}

Filtering

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

{
  "filter": {
    "a_custom_checkbox_attribute": true
  }
}
{
  "filter": {
    "a_custom_checkbox_attribute": {
      "value": {
        "$eq": false
      }
    }
  }
}