Skip to content

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

ConstraintApplies ToDescription
Not BlankTextValue cannot be empty or whitespace
MinNumbersValue must be at least this number
MaxNumbersValue must be at most this number
Min LengthTextMinimum number of characters
Max LengthTextMaximum number of characters
PatternTextMust match a regular expression
EmailTextMust be a valid email address
URLTextMust be a valid URL
PositiveNumbersMust be greater than zero
NegativeNumbersMust be less than zero
Positive or ZeroNumbersMust be zero or greater
Negative or ZeroNumbersMust be zero or less
PastDatesMust be in the past
FutureDatesMust be in the future

Adding a Column Constraint

  1. Select a column in the properties panel
  2. Scroll to the Constraints section
  3. Choose a constraint type from the dropdown
  4. Configure the value (if required) and error message
  5. 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

ConstraintDescription
Unique CompositeCombination of selected fields must be unique across all rows
Field Less ThanFirst field must be less than second field
Field Less Than or EqualFirst field must be less than or equal to second field
Field Greater ThanFirst field must be greater than second field
Field Greater Than or EqualFirst field must be greater than or equal to second field
Fields Not EqualTwo fields must have different values
Conditional RequiredField is required when another field has a value
At Least One RequiredAt least one of the selected fields must have a value
All or NoneAll selected fields must have values, or none of them

Example: Date Range Validation

To ensure a "Start Date" is always before an "End Date":

  1. Open the View tab in the properties panel
  2. Add an entity constraint of type Field Less Than
  3. Select "Start Date" as the first field and "End Date" as the second
  4. 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.

SchemaStack Documentation