Skip to main content

Limit a field to a specific number of items using item count

Log in to add to favourites

The item count validation rule checks that the number of items that are added to a field supporting multiple items meets a minimum or maximum value, or is between a range of expected values.

Use this validation method when you want to restrict how many images, assets or entries an author can select when creating an entry. Alternatively you can use this validation rule to determine how many fields can be added to a repeatable field.

Appearance

An example of a feature component with a maximum item count set.
An example of a feature component with a maximum item count set.

Set the validation

With a content type open for editing:

  1. Select the field that has been set to allow multiple items, such as Image, Asset or Component, and pick the Validation tab from the Field Settings panel.
  2. Choose one of the following options from the Number of items dropdown:

Between allows you to set minimum and maximum values for an expected item count range.

Minimum of allows you to set a minimum item count that needs to be met.

Maximum of allows you to set the maximum number of items that can be added.

You can enter a custom validation message in the Validation Message text box. This will be displayed if the field fails validation when published.

Still need help?

If you still need help after reading this article, don't hesitate to reach out to the Contensis community on Slack or raise a support ticket to get help from our team.
New support request