Constraints & Validation
Constraints enforce data quality at the schema level. When a user enters data that violates a constraint, they see a clear error message before the data is saved.
Column Constraints
Column constraints validate a single field's value. Select a column in the properties panel to manage its constraints.
Available Types
| Constraint | Applies To | Description |
|---|---|---|
| Not Blank | Text | Value cannot be empty or whitespace |
| Min | Numbers | Value must be at least this number |
| Max | Numbers | Value must be at most this number |
| Min Length | Text | Minimum number of characters |
| Max Length | Text | Maximum number of characters |
| Pattern | Text | Must match a regular expression |
| Text | Must be a valid email address | |
| URL | Text | Must be a valid URL |
| Positive | Numbers | Must be greater than zero |
| Negative | Numbers | Must be less than zero |
| Positive or Zero | Numbers | Must be zero or greater |
| Negative or Zero | Numbers | Must be zero or less |
| Past | Dates | Must be in the past |
| Future | Dates | Must be in the future |
Adding a Column Constraint
- Select a column in the properties panel
- Scroll to the Constraints section
- Choose a constraint type from the dropdown
- Configure the value (if required) and error message
- Click Add
Custom Error Messages
Each constraint has an error message shown to users when validation fails. Write clear, actionable messages like:
- "Email address is required" (not "Validation error")
- "Price must be greater than 0" (not "Invalid value")
Entity Constraints
Entity constraints validate relationships between multiple columns. Manage them in the View tab of the properties panel.
Available Types
| Constraint | Description |
|---|---|
| Unique Composite | Combination of selected fields must be unique across all rows |
| Field Less Than | First field must be less than second field |
| Field Less Than or Equal | First field must be less than or equal to second field |
| Field Greater Than | First field must be greater than second field |
| Field Greater Than or Equal | First field must be greater than or equal to second field |
| Fields Not Equal | Two fields must have different values |
| Conditional Required | Field is required when another field has a value |
| At Least One Required | At least one of the selected fields must have a value |
| All or None | All selected fields must have values, or none of them |
Example: Date Range Validation
To ensure a "Start Date" is always before an "End Date":
- Open the View tab in the properties panel
- Add an entity constraint of type Field Less Than
- Select "Start Date" as the first field and "End Date" as the second
- Set the error message to "Start date must be before end date"
Enabling and Disabling
Each constraint has an enabled toggle. Disable a constraint temporarily without deleting it — useful during data migration or bulk imports.
Reordering
Drag constraints to reorder them. Constraints are evaluated in order, and the first violation is shown to the user.