Documentation/Templates/Validation Rules

Validation Rules

Built-in rules to validate import data

Overview

Validation rules ensure that imported data meets your requirements before it's accepted. Each column can have multiple validation rules applied. When data fails validation, users see clear error messages and can correct the issues before completing the import.

Available Rules

Minimum LengthminLength
Ensures the value has at least N characters.

Applies to

stringemailurlphone

Default Error

Must be at least {value} characters

Example

Configuration

minLength: 3

Valid

"John"

Invalid

"Jo"
Maximum LengthmaxLength
Ensures the value has at most N characters.

Applies to

stringemailurlphone

Default Error

Must be at most {value} characters

Example

Configuration

maxLength: 50

Valid

"Short text"

Invalid

"A very long text that exceeds the maximum..."
Minimum Valuemin
Ensures the numeric value is at least N.

Applies to

number

Default Error

Must be at least {value}

Example

Configuration

min: 0

Valid

5, 100, 0

Invalid

-1, -100
Maximum Valuemax
Ensures the numeric value is at most N.

Applies to

number

Default Error

Must be at most {value}

Example

Configuration

max: 1000

Valid

500, 1000

Invalid

1001, 5000
Regex Patternregex
Validates the value against a regular expression pattern.

Applies to

stringemailphone

Default Error

Must match pattern: {value}

Example

Configuration

regex: "^SKU-\d{5}$"

Valid

"SKU-12345"

Invalid

"SKU-1234", "ABC-12345"
Allowed Valuesenum
Restricts the value to a predefined list of options.

Applies to

stringnumber

Default Error

Must be one of: {value}

Example

Configuration

enum: ["active", "inactive", "pending"]

Valid

"active", "inactive"

Invalid

"suspended", "deleted"
Unique Valuesunique
Ensures all values in this column are unique across the import.

Applies to

stringnumberemail

Default Error

Duplicate value found

Example

Configuration

unique: true

Valid

All different values

Invalid

Duplicate values in different rows

Custom Error Messages

Each validation rule can have a custom error message. This allows you to provide context-specific feedback to users when their data doesn't meet requirements.

json
{
  "type": "regex",
  "value": "^SKU-\\d{5}$",
  "message": "Product code must be in format SKU-XXXXX (e.g., SKU-12345)"
}

Next Steps