Form validation lets you set rules for the answers reps enter, catching invalid values before a form is submitted. By enforcing valid formats and numeric ranges at the point of entry, you ensure high-quality field data, eliminate manual data cleaning, and prevent errors before submission.
If a rep accidentally types 2,000 instead of 20, or enters an email without the @, the app flags it right away, and the form can't be submitted until it's fixed. You get clean, reliable data in your reports, with no manual cleanup afterwards.
What you can validate
You can validate two question types, both on their own and numeric as columns inside a Matrix question.
| Question type | Rule you set | Example | What the rep sees if the answer is wrong |
| Numeric (and Numeric Matrix columns) | Minimum value, maximum value, or both | Shelf facings between 0 and 50 | Value must be at least 0 / Value must be at most 50 |
| Text | A format pattern (regular expression, or "regex") | A valid email address, a 10-digit phone number, a store ID like REP-12345 | The answer doesn't match the required format |
Set a number range (Min / Max)
Use a number range to stop unrealistic values, such as facings, shelf prices, temperatures or percentages.
- In the Web app, go to Forms and open, create, or edit a form template.
- Select a Numeric question, or a Numeric column inside a Matrix question.
- Under Validation, enable regex Format validation and enter a Minimum value, a Maximum value, or both. Decimals and negative numbers are supported.
- Click Save.
The error message tells the rep which limit they crossed. For a 0 to 1,000 range, entering 2,000 shows "Value is outside the allowed range”.
Example: Rep view on Number type questions
Example: Rep view on Matrix Number type questions (rep will have to click on product that shows error to see the message "Value is outside the allowed range")
Text format (regex)
What is regex?
Regex stands for Regular Expression. It is a special sequence of characters used to find or match a specific pattern in text.
In Repsly forms, regex helps you check whether a text answer is written in the correct format. For example, you can use regex to validate an email address, date, ZIP code, phone number, or customer ID.
The pattern is written as a regular expression (regex): a short code that describes what a valid answer looks like. You don't need to write regex yourself. Copy a pattern from the table below, or ask an AI tool to create one for you.
- In the Web app, go to Forms and open your form template.
- Select a Text question.
- Under Validation, enable regex Format validation and paste your pattern. In the example below, we've set the validation to accept letters and spaces only as an answer.
- Click Save.
If an answer doesn't fit the pattern, the rep sees "Doesn’t match the required format".
Example: Rep view on the Text type questions (in the example below, we've set the validation to accept letters and spaces only as an answer).
Form Builder checks your pattern. If what you paste isn't a valid regex, you'll see an error message “This regular expression isn't valid". Check the syntax and try again. You won't be able to save until it's fixed. This makes sure the rule works.
Ready-to-use patterns
Copy any of these patterns into the Pattern field.
| What you want to collect | Pattern to copy | Accepts | Rejects |
| Email address | ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ | name@company.com | name@company |
| US phone number (10 digits) | ^?([0-9]3)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$ | 555-123-4567, (555) 123 4567 | 555-1234 |
| Phone number, digits only (7 to 15) | ^[0-9]{7,15}$ | 5551234567 | 555-12 |
| US ZIP code (5 digits or ZIP+4) | ^\d{5}(-\d{4})?$ | 90210, 90210-1234 | 9021 |
| ID with a fixed prefix | ^REP-[0-9]{5}$ | REP-12345 | REP12345 |
| Numbers only | ^[0-9]+$ | 004512 | 45A12 |
| Letters and spaces only | ^[a-zA-Z\s]+$ | Main Street | Main St. 5 |
| Length between 5 and 20 characters | ^.{5,20}$ | Aisle 4 endcap | Ok |
Need a different format? Ask AI. Describe the format in plain words and ask for the whole answer to match, for example:
Write a regular expression that matches the whole answer, from ^ to $, for a store code made of 2 capital letters followed by 4 digits, like AB1234.
Paste the result into the form question that has regex format validation checked, then test it with a correct and an incorrect example on a test form before you roll it out to reps.
What reps experience
Validation works the same way on iOS and Android.
- Instant feedback: an error appears under the answer as soon as it breaks a rule and disappears once it's corrected. On mobile, number errors read "Value is outside the allowed range", and text errors read"Doesn’t match the required format".
- Submission is blocked until errors are fixed: reps can tap Submit, but the form won't go through while any answer is invalid.
- Works offline: rules are saved on the rep's device when they sync, so validation works without an internet connection.
- Editing a submitted form: the form is checked against the rules that were active when it was originally submitted. Later changes to the template don't affect it.
FAQs
Can I add validation to forms I already use? Yes. New rules apply to new submissions once reps sync their devices. Past submissions stay unchanged.
Can I write my own error message? No. Reps see a standard message: the allowed minimum or maximum for numbers, and "The answer doesn't match the required format" for text.
To help reps, describe the expected format in the question name or description, for example, "Store email (name@company.com)".
Does validation work in Matrix questions? Yes. Numeric columns inside a Matrix question support the same rules.
Do I need to know regex? No. Use the ready-to-use patterns above, or ask an AI tool to write one for you.