Adding & Managing Validation Rules
Learn how to create, edit, and manage validation rules to ensure data quality in your Knack application.
What You'll Learn
This guide walks you through the process of setting up validation rules for your fields. You'll discover how to add new rules, edit existing ones, implement multiple conditions, and remove rules when they're no longer needed.
Adding a Validation Rule
To add a validation rule to a field:
- Select the DataTable containing the field you want to validate
- From the right panel, select the Validation Rules icon
- Click + Validation Rule

Add Validation Rules from the right panel
- Configure your rule with three components:
- When: Select a field, one or more conditions, and value
- Show Message: Enter the error message to display when validation fails
- Save

Add a Validation Rule
The conditions available in the dropdown will depend on the type of field you're working with. For example:
- Text fields: Contains, Does not contain, Is, Is not, etc.
- Number fields: Is higher than, Is lower than, Is not, etc.
- Date fields: Is after, Is before, Is between, etc.
Edit, Duplicate, or Delete a Validation Rule
To modify an existing validation rule:
- Select the DataTable containing the field with the rule
- Open Validation Rules in the right panel
- Hover in the validation rule and select the Edit, Duplicate, or Delete icon.
- Save your changes

Edit, Duplicate, or Delete a Validation Rule
Deleting the Validation Rule will permanently remove the rule(s). Confirm this is the correct action before proceeding.
Multiple Validation Rules
You can add multiple validation rules to a single field to check for different conditions. This allows for more comprehensive validation:
- Create your first validation rule
- Click the "Add Condition" button to add another condition
When multiple rules are applied:
- All rules must pass for the data to be accepted
- If any rule fails, the corresponding error message will be displayed
- The field will be highlighted to indicate validation failure

Multiple conditions in a Validation Rule
Notes & Troubleshooting
- Validation rules work for:
- Form submissions
- Manual record additions and edits in the DataTable
- Record additions and edits in the Live App
- Fields used in validation rules must be included in the Live App's element to be validated
- Validation rules are not checked during:
- Imports into the DataTable
- Validation rules do not check for case-sensitivity
Tip: Write clear, specific error messages that tell users exactly what they need to fix. For example, "Date of birth must not be in the future" is more helpful than "Invalid date"
Updated 8 days ago