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

min_items_message

Table of contents

Description:

This key defines a custom error message that explains why a value has failed the validation criteria from options.min_items.

This key requires you to define options.min_items.

This key has no default.

This key is available for Array and Multiselect or Multichoice Inputs.

Appears in:
└── _inputs
    └── *
        ├── Multiselect Input
        │   └── options
        │       └── min_items_message
        ├── Multichoice Input
        │   └── options
        │       └── min_items_message
        └── Array Input
            └── options
                └── min_items_message
Type:
string
Examples:

In this example, we prompt our team to enter a valid number of items using a custom message.

Copied to clipboard
_inputs:
  featured_posts:
    type: array
    options:
      max_items: 5
      max_items_message: Cannot be more than 5
      min_items: 2
      min_items_message: Cannot be less than 2
{
  "_inputs": {
    "featured_posts": {
      "type": "array",
      "options": {
        "max_items": 5,
        "max_items_message": "Cannot be more than 5",
        "min_items": 2,
        "min_items_message": "Cannot be less than 2"
      }
    }
  }
}
Open in a new tab