Skip to main content
Input validation ensures users provide data in the correct format before proceeding. Wizflow offers several validation types that can be applied to most entities.
When to use validation: Add validation rules when you need to enforce specific formats (like phone numbers or ID codes) or business rules (like age ranges or character limits).

Validation Types

Wizflow provides 8 built-in validation types to cover common validation scenarios.

Regex Pattern

Use case: Custom format validation (phone numbers, postal codes, IDs)
Commonly used with: Text, Text Area, Number

Range Validation (InRange)

Use case: Ensure numbers fall within min/max bounds
Commonly used with: Number, Amount, Age, Year

Length Validation (LengthInRange)

Use case: Enforce minimum or maximum character counts
Commonly used with: Text, Text Area

No Duplicate Value

Use case: Prevent repeated entries across a flow
Commonly used with: All input types

CPR Validation

Use case: Validate Danish CPR number format
Commonly used with: Text, Formatted Number

CPR Modulus 11

Use case: Strict CPR validation with modulus 11 checksum
Commonly used with: Text, Formatted Number

Choices Validation

Use case: Ensure valid selection in choice entities
Commonly used with: Choice, Multi-choice

Reject Choice

Use case: Block specific choices with custom actions
Commonly used with: Choice, Multi-choice

Regex Validation

Regex (Regular Expression) validation lets you define custom patterns that user input must match. This is the most flexible validation type for enforcing specific formats.

Configuration

Common Regex Examples

Copy and paste these patterns directly into your entity validation settings.
Danish Phone Number (8 digits)
Error message: Please enter a valid 8-digit phone numberDanish Phone with Country Code
Error message: Please enter a valid Danish phone number (e.g., +45 12 34 56 78)International Phone (E.164 format)
Error message: Please enter a valid international phone number starting with +

Range Validation

Ensure numeric values fall within acceptable bounds.

Configuration

Examples

Adult Only (18+)
  • Min: 18
  • Max: 120
Working Age
  • Min: 18
  • Max: 67
Senior Discount Eligibility
  • Min: 65
  • Max: 120
Loan Amount
  • Min: 10000
  • Max: 5000000
Monthly Premium
  • Min: 100
  • Max: 50000
Percentage (0-100)
  • Min: 0
  • Max: 100

Length Validation

Control the minimum and maximum number of characters in text inputs.

Configuration

Examples


No Duplicate Value

Prevent users from entering values that have already been submitted in the same flow session.

Configuration

Use Cases

  • Prevent duplicate email entries in multi-person forms
  • Ensure unique reference numbers
  • Avoid repeated selections in list-based inputs

CPR Validation

Validates that input matches the Danish CPR (Central Person Register) number format. This is a format-only validation that checks the structure of the CPR number.

Configuration

No additional configuration required. Simply add the CPR validation type to your entity.

What It Validates

  • 10-digit format (DDMMYY-XXXX)
  • Valid date portion (day, month, year)
  • Correct structure with or without hyphen

Use Cases

  • Customer onboarding flows
  • Insurance applications
  • Banking KYC processes
  • Any flow requiring Danish personal identification
This validation checks format only. For stricter validation including the mathematical checksum, use CPR Modulus 11 instead.

CPR Modulus 11

A stricter CPR validation that includes the modulus 11 checksum verification. This ensures the CPR number is not only correctly formatted but also mathematically valid.

Configuration

No additional configuration required. Simply add the CPRModulus11 validation type to your entity.

How It Works

The modulus 11 algorithm multiplies each digit by a weight factor and checks if the sum is divisible by 11. This catches typos and invalid numbers that might pass basic format validation.

When to Use

Some valid CPR numbers issued after 2007 may not pass modulus 11 validation due to changes in the Danish CPR system. Consider your use case when choosing between CPR and CPR Modulus 11.

Choices Validation

Ensures that a valid selection has been made in choice-based entities. This validation is typically applied automatically to required choice fields.

Configuration

No additional configuration required. The validation ensures at least one valid option is selected.

Use Cases

  • Required single-choice questions
  • Multi-choice with minimum selection requirements
  • Dropdown menus that must have a selection

Reject Choice

Block specific choices from being accepted, optionally with custom error messages, warnings, or automated actions like redirects or tooltips.

Configuration

Available Actions

Redirect the user to a different URL when they select the rejected choice.
Display a modal with a video and title when the rejected choice is selected.
Show contextual tooltips to guide the user after selecting the rejected choice.

Examples

Block Ineligible Users
Redirect to Alternative Flow
Show Educational Video

Combining Validations

You can apply multiple validation rules to a single entity. Validations are checked in order, and the first failing rule displays its error message. Example: Secure Reference Code
  1. Length Validation: Min 8, Max 12
  2. Regex: ^[A-Z0-9]+$ - Uppercase letters and numbers only
  3. No Duplicate Value: Key reference_codes

Best Practices

Clear Error Messages

Write specific, helpful messages that tell users exactly what’s expected. Avoid generic errors like “Invalid input.”

Test Your Patterns

Always test regex patterns with valid and invalid examples before publishing. Use online tools like regex101.com.

Consider Mobile Users

Some patterns work better with specific keyboard types. Consider using inputmode attributes for phone numbers and numeric codes.

Localize Messages

Error messages support translations. Provide translated versions for all languages your flow supports.

Regex Quick Reference