The Boolean data type is associated with conditional statements that, depending on whether the condition evaluates as true or false, modifies actions or options.
Select the field in your Custom type page, give it a name, and then you have the option of assigning names for the placeholder of each value to make it clearer for the writers.
If you pick a default value, this will automatically be reflected in the API response.
And finally, in your writing room pick the desired value and save.
The following is the JSON code for adding a Boolean field:
"placeholder_false": "Add a label for the False value...",
"placeholder_true": "Add a label for the True value...",
"type": (string, required) Value must equal "Boolean"
"config": (object, optional) Options listed below
"label": (string) Sets the label that shows up for the field in the entry editor
"placeholder_false": (string) Sets a user-friendly placeholder into the field
"placeholder_true": (string) Sets a user-friendly placeholder into the field
"default_value": (string) selecting this option will default to this option to be true
Note that when you add a new Boolean field with a default value to a Custom Type thats has existing documents, then these existing documents will not be automatically updated with the default value. You'll need to re-publish the existing document for the new default value to take effect.
There's just one thing left to do
Just get in touch with us via the chat button on the website if you would like Boolean Fields activated on your Prismic repo. We are always confident in a feature by the time it reaches the Beta testing phase, but user feedback and testing at this stage helps us with our feature and product development.