☁️ Loving our new documentation website? Provide feedback in the CloudCannon Community! ✨

allow_empty

Table of contents

Description:

⚠️ DEPRECATED: This key is deprecated. If you want to prevent empty values, we recommend setting _inputs.*.options.required to true instead.

This key toggles whether CloudCannon will accept empty values, and pre-select the first option if opened with an empty value.

Setting this key to true will allow CloudCannon to accept empty values.

Appears in:
└── _inputs
    └── *
        ├── Select Input
        │   └── options
        │       └── allow_empty
        ├── Multiselect Input
        │   └── options
        │       └── allow_empty
        ├── Choice Input
        │   └── options
        │       └── allow_empty
        └── Multichoice Input
            └── options
                └── allow_empty
Type:
boolean
Examples:

In this example, CloudCannon will accept empty values for a Select Input.

Copied to clipboard
_inputs:
  category:
    type: select
    options:
      values:
        - Blog
        - News
        - Events
      allow_empty: true
{
  "_inputs": {
    "category": {
      "type": "select",
      "options": {
        "values": [
          "Blog",
          "News",
          "Events"
        ],
        "allow_empty": true
      }
    }
  }
}
Open in a new tab