Set Required, Default, and Validation Rules
Required fields, default values, placeholders, length limits, number ranges, and patterns are set on each form, in the field's Configure Field drawer. The same entity field can be required on an application form and optional on a staff update form. This guide covers each setting, which field types support it, and how it is enforced.
Prerequisites
- The form exists and the field is on it. See Create a Form.
- Your role has Configure Form on the form.
Rules belong to the form
These settings apply only to the form you set them on. They do not apply to other forms or to the record add and edit forms staff open from a grid with Add Record and Edit. Entity fields do not have a unique-value setting.
Steps
Open the field on the form
In the form builder, click the field. The Configure Field drawer opens.
Set the general settings
Under General, set the Label (up to 35 characters) and Placeholder (up to 35 characters) for this form, a Default Value to prefill, and a Field Description. The description shows on the form when Show Field Description is on in Configure Form.
Make the field required
Under Rules, turn on Required ("Makes this field mandatory for form submission"). Leave the mode on Always, or choose Based on the condition to require it only in some cases. See Conditional Logic.
Set validation limits
Under Validation, fill in the limits offered for the field's type, such as Minimum Length and Maximum Length for text, or Minimum Value and Maximum Value for numbers. For text, you can also enter a Pattern (Regex) and an Example of a valid value.
Click Update
Click Update to save the field's settings, or Cancel to discard them.
Which settings each field type supports
| Field type | Placeholder | Default Value | Validation |
|---|---|---|---|
| Text, Textarea | Yes | Yes | Minimum Length, Maximum Length, Pattern (Regex) with Example |
| Yes | Yes | Minimum Length, Maximum Length (the email format is checked automatically) | |
| Url | Yes | Yes | None |
| Number | Yes | Yes | Minimum Value, Maximum Value |
| Phone | Yes | Yes | None |
| Dropdown, Radio, Checkbox | Dropdown only | Yes | None |
| Boolean | No | Yes | None |
| Date | Yes | Yes | None |
| Richtext, Json, Location | Yes | Yes | None |
| Time, Time Range, Date Range, User | Yes | No | None |
| Signature | Yes | No | None |
| File | No | No | The file restrictions set on the entity apply |
| Apo | No | No | Address Required, Parcel Required, Owner Required instead of Required |
| Association | See below | No | None |
Every field type that can be placed on a form supports Required, except Apo fields, which have the three separate switches above.
New text fields start with a Maximum Length of 255 characters and new Textarea fields with 1,000. Maximum Length must be greater than or equal to Minimum Length, and Maximum Value greater than or equal to Minimum Value.
How the rules are enforced
| Rule | When it is checked | Message people see |
|---|---|---|
| Required | When the step or form is submitted, in the browser and again by the server | The field label followed by is required |
| Minimum Length / Maximum Length | When the step or form is submitted, in the browser and again by the server | The allowed number of characters |
| Minimum Value / Maximum Value | When the step or form is submitted, in the browser and again by the server | The allowed range |
| Pattern (Regex) | In the browser, before the step or form can be submitted | A pattern error, with your Example as a hint |
Association fields
When the field links to another entity, the drawer has extra settings:
| Setting | What it does |
|---|---|
| Layout Type | Shows linked records as Pills or Cards |
| Fields | Which fields of the linked record are shown |
| Allow Creation Of Record | Lets people create a new linked record from the form |
| Record Filter | Limits which records can be picked on this form |
| Auto-fill with Logged-in Contact, Auto-fill with Logged-in User, Allow User Change | For links to contacts: prefill the person submitting the form, and choose whether they may change it |
Example
Settings on a Contractor License Application form.
| Field | Settings |
|---|---|
| License Number | Required Always. Pattern (Regex): ^[A-Z]{2}[0-9]{6}$. Example: AB123456 |
| Business Name | Required Always. Maximum Length 100 |
| Years in Business | Minimum Value 0, Maximum Value 100 |
| License Type | Default Value: General Contractor |
| Business Phone | Placeholder: (555) 555-0100 |
| Insurance Certificate | Required Always |
Common mistakes
- Expecting a required rule to apply everywhere. It applies to this form only. Set it on every form that needs it.
- Testing a pattern only in your head. Try the form with valid and invalid values. A pattern with a typo rejects every entry.
- Leaving Example empty. Without an example, applicants do not know what format is expected.
- Requiring a field that is hidden by a condition. If a field is hidden, applicants cannot fill it in. Make it required Based on the condition that also shows it.
- Looking for a unique setting. It does not exist. Use a pattern or a review step to catch duplicates.