The following feature utilizes RegEx, a form of coding, and we recommend that you consult your developers/tech team and test your data entry validation.
In the Data Collection Stage, short answers can be restricted to follow a specific format using Data Entry Validation. You can customize the parameters to what the applicant can enter. For example, Data Entry Validation can ensure that the answer to the short answer question "California Driver's License number" must start with a letter followed by 7 digits.
To express this validation format, you'll be using Regular Expression (RegEx), a coding language that uses a sequence of characters that defines a pattern. We recommend you consult your developers to help ensure your RegEx is functioning as intended.
Adding Validation to Short Answer
You can only use the Data Entry Validation feature for custom questions with a short answer.
- Add a Data Collection stage.
- Click Customize fields for data collection stage.
- Click Add Question. Type in your custom question and data key.
- Choose Short answer as your answer type. Click the checkbox on the bottom right of the question.
- On the left text box, enter in the format the answer needs to be in using RegEx.
Note: Acceptable RegEx
You do not need to input "/” to start and end your expression. When entering your Regular Expression into Fountain, only include the pattern. See below for common RegEx validations.
- On the right text box, enter the error message applicants will get if they enter an incorrect format.
We recommend that your error message explicitly tells the applicant what the input should be. i.e. "Zip Code should be 5 digits."
- Click Save, and you're set!
Common RegEx Validations
Copy-paste the RegEx into the Enter Regular Expression text box if you want to use it. Keep in mind that these will not have the "/” that starts and ends the expression, as these are unnecessary. These are some of the common expressions -- for more complex expressions, please consult your developers/tech team.
|Data Type||RegEx checks for:||Regular Expression|
|Social Security Number||9 digits||
|Zip Code (US)||5 digits||
|Bank Number (US)||4 to 17 digits||
|Passport||6 to 9 upper-case letters or digits||
|License Plate Number (CA)||1 digit, then 3 upper-case letters, then 3 digits||
|Driver's License Number (CA)||1 upper-case letter and 7 digits||
||Must have an @, then a period, with characters throughout||
^(0[1-9]|1)[- /.](0[1-9]|[0-9]|3)[- /.](19|20)\d\d$
^(0[1-9]|[0-9]|3)[- /.](0[1-9]|1)[- /.](19|20)\d\d$
Here are some additional external resources to use as reference and testing when building your RegEx.