Product teams should be thinking differently about documents.Read blog post.
Anvil Logo
Products
Industries
Resources
Developers
Workflows

Set field character limits

Some field types like numeric text already allow you to set a minimum and maximum length through the UI. For other fields like short and long text field types, you’ll need to set min and max character length with the advanced JSON editor.

Please note that the advanced JSON editor is only available on Custom plans.

Back to Help Center

Character limits are set at the individual field level and both minimums and maximums can be set simultaneously or individually. Permissible length must be defined as a character count, so you’ll need to determine how many characters you’d like to allow and enter that number in your validation.

Character limit validation error messages can’t be customized. If the user submission value doesn’t meet validation criteria, then either of the following messages will be displayed after the user exits the input field:

  • "Should not be longer than _"
  • "Should not be shorter than _"

Set character limits on fields

Here are the validation keys you can add to your short and long text type fields:

  "validation": {
    "minLength": 15,
    "maxLength": 100
  },
Back to Help Center

Other common posts

1 - 0 of 0

Contact support

We know dealing with tech support can be painful. It's our goal to help you as quickly and efficiently as possible. Once we get your message, we will email you back as soon as we can.
    Want to try Anvil first?Sign up for free