Our latest updates include some great form validation enhancements for even better quality control over your data. These enhancements include supporting custom validation patterns for text fields by defining a regular expression (regex), as well as the ability to define min/max limits for certain field types.
Pattern matching with Regex
We’ve added a feature that lets you define custom text validation in our app designer using a regular expression pattern. The validation pattern builder includes several popular regex patterns, but you can also paste in any valid custom pattern.
For example, if you want a text field to accept only years between 1900 and 2099, you can use a specific regex pattern. When designing your data collection form, you could include this pattern: [(19|20)[d]{2,2}]
. Within the app designer, you can test the regex pattern to ensure it functions correctly before deployment.
If an entry doesn’t match the pattern, both web and mobile users will receive an alert and must correct it. The system will prevent them from saving the record until the input meets the required format.
Min/max field validations
In addition to pattern matching, we’ve included the ability to set min/max restrictions for several field types. These validations vary by field type with the following fields currently supported:
- Text Field– Set the min and max character length for a text field.
- Numeric Field– Set the min and max character length for a numeric field.
- Multiple Choice– Set the min and max number of selections that can be made.
- Photos/Videos– Set the min and max number of photos that can be captured.
- Repeatable Section– Set the min and max number of child records that can be created.
Field validation and data integrity
The importance of data integrity cannot be understated when it comes to field data collection. Data collection is expensive, and if you are paying field crews to collect information, you want the data they capture to be of the highest quality so that it can be readily analyzed, mapped, or queried. These validation enhancements, along with advanced visibility rules and requirement condition logic allow you to create highly sophisticated data collection apps that combine field efficiency with data integrity.
Now go out there and brush up on your regex skills! Because you never know when you might be called upon to save the day!

Courtesy of: xkcd.com