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

PropertyDescription
regexThe regular expression pattern to match against
messageError message shown when validation fails (supports translations)

Common Regex Examples

Copy and paste these patterns directly into your entity validation settings.
Danish Phone Number (8 digits)
^\d{8}$
Error message: Please enter a valid 8-digit phone numberDanish Phone with Country Code
^(\+45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$
Error message: Please enter a valid Danish phone number (e.g., +45 12 34 56 78)International Phone (E.164 format)
^\+[1-9]\d{6,14}$
Error message: Please enter a valid international phone number starting with +

Range Validation

Ensure numeric values fall within acceptable bounds.

Configuration

PropertyDescription
minMinimum allowed value
maxMaximum allowed value

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

PropertyDescription
minLengthMinimum number of characters required
maxLengthMaximum number of characters allowed

Examples

Use CaseMin LengthMax Length
Name field2100
Short description10200
Comment/feedback201000
Reference code66
Password8128

No Duplicate Value

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

Configuration

PropertyDescription
keyUnique identifier for the duplicate check group

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

ScenarioRecommended Validation
Quick format checkCPR
High-security flows (banking, insurance)CPR Modulus 11
Government integrationsCPR Modulus 11
Customer self-serviceCPR
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

PropertyDescription
choiceKeyThe key of the choice to reject
choiceCount(Optional) Comparison operator and value for multi-choice scenarios
message.error(Optional) Error message to display (supports translations)
message.warning(Optional) Warning message to display (supports translations)
action(Optional) Automated action to trigger

Available Actions

Redirect the user to a different URL when they select the rejected choice.
PropertyDescription
urlRedirect URL (external: https://site.com or internal: /page). Use {{LOCALE}} placeholder for locale-aware URLs.
Display a modal with a video and title when the rejected choice is selected.
PropertyDescription
titleTextModal title (supports translations)
urlVideo URL to display
Show contextual tooltips to guide the user after selecting the rejected choice.
PropertyDescription
containerIDID of the container element
timeoutInMsHow long tooltips remain visible
tooltipsArray of tooltip configurations with referenceID and label

Examples

Block Ineligible Users
choiceKey: "under_18"
message.error: "You must be 18 or older to proceed"
Redirect to Alternative Flow
choiceKey: "business_account"
action.type: "reroute"
action.url: "/business-onboarding"
Show Educational Video
choiceKey: "unsure"
action.type: "video-modal-message"
action.titleText: "Understanding Your Options"
action.url: "https://example.com/explainer-video.mp4"

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

PatternMeaning
^Start of string
$End of string
\dAny digit (0-9)
\DAny non-digit
\wWord character (a-z, A-Z, 0-9, _)
\sWhitespace (space, tab, newline)
.Any character except newline
+One or more of the previous
*Zero or more of the previous
?Zero or one of the previous (optional)
{n}Exactly n occurrences
{n,m}Between n and m occurrences
[abc]Any character in the brackets
[^abc]Any character NOT in the brackets