Validation Rules
introduction validation rules help ensure the data submitted through your forms is accurate, complete, and usable alongside built in field validation, you can create custom rules to enforce specific business logic β such as matching values or formatting requirements validation runs automatically during form completion and whenever entries are updated, helping prevent incorrect data from reaching your workflows or storefront processes π§± built in validation every field type includes basic automatic validation based on its format field type built in checks email valid email structure url valid web address number numeric value within range date valid date format phone contains valid digits file upload file type and size limits these checks run without additional setup, helping catch common errors early βοΈ custom validation rules custom rules allow you to define additional conditions beyond standard field validation adding a validation rule select a field in the form builder open the validation tab click add rule define the condition and error message save your changes each rule includes component purpose condition defines when the field becomes invalid error message text shown to the customer rules trigger when the condition evaluates to an error state π§ types of validation you can build π simple value validation check a fieldβs own value example must be at least 10 characters used for password strength reference numbers minimum input requirements π cross field validation compare one field against another examples confirm email matches original email end date occurs after start date this is useful when multiple fields need to stay aligned π conditional validation apply rules only when certain conditions are met example if country = us validate zip code format conditional validation keeps forms flexible while maintaining data quality π supported validation operators validation uses the same logic operators as conditional logic text validation operator example use matches pattern regex format checks contains must include a value starts with required prefix ends with required suffix numeric validation operator example use greater than / equal minimum quantity less than / equal maximum value equals / not equals exact match length validation operator example use minimum length password rules maximum length reference codes exact length postcodes or ids format validation operator example use is email email format check is number numeric value is integer whole numbers is alpha / alphanumeric character restrictions these allow you to enforce consistent formatting across submissions please note that the availability of operators depends on the type of field you are configuring π¬ writing effective error messages clear messages help customers fix issues quickly recommended approach explain whatβs wrong show how to fix it avoid technical wording keep messages short example β
βphone number must include area codeβ β βinvalid inputβ dynamic messages can also reference values using templates β for example showing a required minimum value π validation states entry validation status state meaning valid all rules pass ready to submit invalid one or more rules fail submitting not allowed pending async validation in progress submitting not allowed field level feedback fields may show error message when invalid success indicator (optional) no indicator before interaction these visual cues help guide customers through completion π§Ύ common validation patterns π
date relationships ensure end dates occur after start dates π unique selections prevent duplicate items in repeatable groups or multi select fields these patterns help maintain clean data across complex forms π validation in workflows workflows can extend validation beyond the form itself on submission, form page change, or field update workflows can perform advanced checks validate against external systems apply cross form logic validation steps add conditions inside workflows to update answers notify teams about invalid data trigger follow up actions this creates a layered validation approach across your entire process π‘ best practices layer your validation built in field validation for format custom rules for business logic workflows for advanced checks improve the user experience validate early rather than only on submit show clear instructions avoid overly strict rules unless necessary test thoroughly check empty values edge cases (min/max) special characters very long inputs keep performance in mind avoid heavy regex where possible limit complex cross field rules use workflows for advanced processing these practices help keep forms fast and reliable as they grow