Configure the Boolean Field

This article explains what the Boolean field is and how to configure it in the Custom Type builder.


The Boolean field allows content writers to select a “true” or “false” value. When you add this field in a Custom Type, it'll be available as a toggle in the documents. You can add custom placeholder values to make it user-friendly.

The following are the instructions to configure a Boolean field in a Custom Type.

Screenshot of the Boolean field in the drag-and-drop editor.

The visual builder

When configuring a Boolean field, you'll see the options to set the Field name, API ID. You can also assign placeholder values for each one. Finally, you can click the checkbox to have the first value default to true.

Screenshot of the Boolean field editor.

Please note that when you add a new Boolean field with a default value to a Custom Type with existing documents, these existing documents will not be automatically updated with the default value. You'll need to re-publish them for the new value to take effect.

JSON model

The following table displays the JSON configuration options available in the JSON editor.

type

string (required)

The value must be Boolean

config

object

Object for the configuration options

config.label

string

The label that shows up for the field in the document editor

config.placeholder_false

string

A user-friendly placeholder for the field's false value

config.placeholder_true

string

A user-friendly placeholder for the field's true value

config.default_value

string

Selecting this option will default the value to be true

Example JSON configuration

The following JSON defines a Boolean field that defaults to true:

Copy
"example_boolean": {
   "type": "Boolean",
   "config": {
     "placeholder_false": "Label for the False value...",
     "placeholder_true": "Label for the True value..."
     "default_value": true,
     "label": "boolean"
  }
}

API response example

Here is an API response example of a Boolean field with the API ID of example_boolean:

Copy
// API response example of a Boolean field

{
 //...
 "example_boolean": true
}

Was this article helpful?
Not really
Yes, Thanks

Can't find what you're looking for? Get in touch with us on our Community Forum.