Field value constraints in Baserow

Field value constraints in Baserow prevent bad data at the source; enforcing uniqueness, required values, and validation rules automatically so your database stays clean without manual checking or post-entry cleanup.

This guide explains how to use field value constraints to enforce data quality rules, prevent duplicate entries, and maintain database integrity through automatic validation.

Field value constraints in Baserow

Overview

Field value constraints are data quality rules that Baserow enforces automatically when users create or update rows. By defining constraints at the field level, you prevent invalid data from entering your database in the first place, eliminating the need for data cleanup, duplicate detection, or manual validation after the fact.

Constraints work like database guardrails; they block operations that would violate your rules and provide immediate feedback to users explaining why the data wasn’t accepted. This real-time validation ensures data integrity across all entry methods: manual entry in Grid View, form submissions, API calls, CSV imports, and automation workflows.

Why use field value constraints

Prevent duplicate records: Enforce unique customer IDs, email addresses, or order numbers to avoid confusion and maintain referential integrity.

Data quality assurance: Block invalid entries at creation time rather than discovering and fixing problems later through manual review.

Regulatory compliance: Meet data standards requiring unique identifiers, non-duplicate records, or validated field values for auditing purposes.

Integration reliability: Ensure external systems receive clean, consistent data through APIs by validating at the database layer.

User guidance: Provide immediate feedback when users attempt invalid entries, teaching correct data entry patterns through enforcement.

Reduce manual cleanup: Eliminate hours spent finding and merging duplicate records by preventing duplicates from being created initially.

How to add a field constraint

Configure constraints through the field’s advanced settings in the field editor.

To add a unique constraint:

  1. Navigate to the table containing the field you want to constrain
  2. Click the dropdown arrow next to the field name
  3. Select Edit field from the menu
  4. Click the Advanced tab in the field editor
  5. In the Constraints section, select your constraint type
  6. Click Save to apply the constraint

Setting field value constraint in advanced settings

Constraints apply immediately after saving. Baserow validates existing data; if current rows violate the new constraint, you’ll receive an error and must fix duplicates before enabling the constraint.

To remove a constraint: Follow the same steps and click the trash icon, then save. Existing data remains unchanged, and duplicate entries become possible again.

Available constraint types

Constraint Enforces Use cases
Unique with empty No duplicates, but empty values permitted Optional unique fields like secondary email, alternate phone

Currently, Baserow supports unique constraints that prevent duplicate values in a field. Additional constraint types (required values, format validation, range limits) are under development and will be released in future updates, expanding data quality controls across your database.

How constraints work

Unique with empty constraint

This constraint prevents duplicate values but permits multiple rows to have empty values in the field. Only populated values must be unique.

Behavior:

  • ✅ Accepts: New unique values not present in any other row
  • ✅ Accepts: Empty/blank values (multiple rows can be empty)
  • ❌ Rejects: Non-empty values that already exist in another row

Supported field types for constraints

Not all field types support constraints. Here’s what can be constrained:

Field type Unique constraint Notes
Single line text ✅ Supported IDs, codes, usernames, SKUs
Long text ✅ Supported Descriptions, notes (rarely used)
Number, Rating, Duration ✅ Supported Order numbers, account numbers
Email ✅ Supported User emails, contact emails
URL ✅ Supported Website URLs, profile links
Date ✅ Supported Unique dates (rare use case)
Single select ⚠️ Limited utility Few options = duplicates needed
Phone number ❌ Not supported Cannot constrain contact numbers, support lines
Boolean ❌ Not useful Only 2 values possible
Multiple select ❌ Not supported Cannot constrain multi-value fields
Link to table ❌ Not supported Relationships handled differently
File ❌ Not supported Cannot constrain attachments
Formula, Last modified, Created on, Last modified by, Created by ❌ Not supported Computed values, not direct entry
Lookup, Count, Rollup, Collaborators ❌ Not supported Retrieved values, not direct entry

Best practice: Apply unique constraints to fields designed to identify records uniquely, not to descriptive or categorical fields where duplicates are natural.

What happens when constraints are violated

Baserow prevents operations that would violate constraints and provides clear error messages explaining the issue.

Manual entry in Grid View

When typing a duplicate value:

  1. User enters a value that already exists
  2. Upon leaving the cell (blur event), Baserow validates
  3. Error message displays: Field data constraint violation. Unable to complete operation due to existing constraints violation.
  4. Value is not saved until the user enters a unique value

Form submissions

When forms include constrained fields:

  1. User submits form with duplicate value
  2. Form submission fails before creating the row
  3. Error message displays: Field data constraint violation. Unable to complete operation due to existing constraints violation.
  4. User must correct the value and resubmit

API operations

API requests violating constraints return error responses:

HTTP status: 400 Bad Request Row creation: Fails, no row is created Response: Includes field-specific error details

CSV imports

When importing data with duplicates:

  1. Baserow validates each row during import
  2. Rows violating constraints are rejected
  3. Import report shows which rows failed: The following row indexes couldn't be imported
  4. Valid rows import successfully
  5. You must clean duplicate data and re-import failed rows

Check for duplicates in your CSV before importing to constrained fields using spreadsheet tools like Excel’s “Remove Duplicates” or conditional formatting.

Constraints and existing data

Adding constraints to populated fields

When adding a constraint to a field containing data, Baserow validates existing values:

If no violations exist:

  • Constraint applies immediately
  • Future entries are validated against existing values
  • No data changes required

If violations exist:

  • Constraint application fails with an error
  • Error message lists duplicate values found
  • You must resolve duplicates manually before enabling the constraint
  • Options: Delete duplicate rows, change values to be unique, or consolidate data

Checking for duplicates before constraining

Before applying a unique constraint, verify no duplicates exist:

  1. Create a filter showing duplicate values
  2. Use a formula field to identify duplicates across rows
  3. Manually search for common values
  4. Export data and use spreadsheet tools to find duplicates

Formula technique: Create a Count field linking back to the same table filtered by the field value; counts over 1 indicate duplicates.

Frequently asked questions

Can I add unique constraints to fields that already have duplicate data?

No, you must resolve all duplicates before applying a unique constraint. Baserow validates existing data when you attempt to enable the constraint and provides error messages showing which values are duplicated. Clean up the duplicates first, then apply the constraint.

What happens if I try to paste duplicate values into a constrained field?

The paste operation fails for cells that would create duplicates. Baserow validates each paste operation and rejects values violating constraints. You’ll see error indicators on the rejected cells and must enter unique values instead.

Do constraints work with forms and API simultaneously?

Yes, constraints are enforced across all data entry methods: manual Grid View entry, form submissions, API operations, CSV imports, and automation workflows. This ensures data quality regardless of how users or systems interact with your database.

Can I temporarily disable a constraint without deleting it?

No, constraints are either enabled or disabled; there’s no temporary suspension. To allow duplicates temporarily, you must remove the constraint entirely through field settings, then re-enable it later. Note that duplicates created during this period must be cleaned before re-enabling.

How do unique constraints handle case sensitivity?

Unique constraints are case-sensitive for text fields. “example@email.com” and “Example@Email.com” are not considered duplicates.

What’s the difference between unique constraints and filters?

Constraints prevent invalid data from being saved (enforcement). Filters hide data from view but don’t prevent creation (display). Use constraints for data integrity rules that must never be violated, and filters for temporary views of data subsets.


Still need help? If you’re looking for something else, please feel free to make recommendations or ask us questions; we’re ready to assist you.