Google Forms Response Validation: Setup Guide
Google Forms response validation lets you set rules for what can be entered in a form field, such as requiring a specific format, a minimum length, or a number within a certain range. This guide shows you how to add these rules so you collect cleaner, more accurate data. You’ll need a Google account and a form with at least one question already added.
What You’ll Need
- A Google account (free)
- A Google Form with at least one question created
- Access to the form editor (forms.google.com or via Google Drive)
Step-by-Step
- Open your form in the editor. Go to forms.google.com, or open the form from Google Drive. Click the form you want to edit.
- Select the question you want to validate. Click on the question in the form editor. The question must be a type that supports validation (see Common Mistakes for which types do not).
- Open the validation menu. In the bottom-right corner of the question box, click the three vertical dots (⋮). From the dropdown menu, select Response validation.
- Choose the validation type. A row of dropdowns appears below the question. The first dropdown lets you pick the type of validation:
- Number – for questions that expect a numeric answer (e.g., age, quantity).
- Text – for answers that must match a text pattern (e.g., contains, doesn’t contain, matches a regular expression).
- Length – for answers that must be a certain number of characters (e.g., minimum or maximum length).
- Regular expression – for advanced pattern matching (e.g., email format, phone number).
- Set the rule. The second dropdown and the input box vary by type:
- Number: Choose greater than, less than, between, equal to, etc. Then enter the value(s). For example, to require an age between 18 and 99, choose between and enter 18 and 99.
- Text: Choose contains, doesn’t contain, equals, or doesn’t equal. Then type the text that must (or must not) appear. For example, to require an answer that contains “@”, choose contains and type
@. - Length: Choose minimum, maximum, or between. Then enter the character count(s). For example, to require a minimum of 10 characters, choose minimum and enter 10.
- Regular expression: Choose matches or doesn’t match, then type a regex pattern. For example, to require a valid email format, use
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$.
- Write a custom error message. In the field labeled Custom error text, type a message that tells the respondent what they did wrong. For example, “Please enter a valid email address.” This message appears if the answer does not meet the rule.
- Test the validation. Click the Preview (eye icon) button in the top-right corner of the editor. Fill out the form with an invalid answer to see if the error message appears. Then try a valid answer to confirm it passes.
- Save and share. Your validation rules are saved automatically. Share the form as usual via email, link, or embed. The validation applies to all respondents.
Common Mistakes
- Applying validation to unsupported question types. Multiple choice, checkboxes, and dropdown questions do not support response validation. Validation only works for short answer, paragraph, and multiple choice grid (for rows) questions.
- Using the wrong regex pattern. Regular expressions are case-sensitive by default. If you want to match “abc” regardless of case, use
(?i)abcor the pattern[a-zA-Z]*. - Not providing a custom error message. Without one, respondents see a generic “This response is invalid” message, which is not helpful. Always add a clear instruction.
- Setting impossible rules. For example, requiring a number between 1 and 10 but also requiring a length of 20 characters. Make sure the rules are logically possible.
- Forgetting that validation only works for new responses. If you add validation after people have already submitted, their existing answers are not retroactively checked.
Tips
- Use regular expression for email, phone, or URL validation. Test your regex on a site like regex101.com before adding it to the form.
- For numbers, use between to set a realistic range. For example, for “How many hours do you sleep?” use between 0 and 24.
- Combine multiple validations by adding more than one rule to the same question. Click Add validation to add another rule. All rules must be met for the answer to be accepted.
- Use the Length validation for short answer questions to prevent one-word responses when you need a detailed explanation.
- Always preview your form after adding validation to ensure the rules work as expected and the error messages are clear.
Troubleshooting
- Validation option is greyed out. This happens when the question type doesn’t support validation. Change the question type to short answer or paragraph, or use a different question type.
- Respondents say they can’t submit even though they followed the rule. Check if you have multiple validation rules that conflict. Also check if the rule is case-sensitive (for text) or if the regex pattern is too strict. Test with the exact input you expect.
- Error message doesn’t appear. Make sure you saved the form (it saves automatically) and that you are testing in the preview mode, not the editor. Also, if the question is not required, respondents can leave it blank without triggering validation.
- Validation works in preview but not in the published form. Clear your browser cache or try an incognito window. If the issue persists, copy the form link and open it in a new browser.
- Can’t add more than one validation rule. You can only add multiple rules if the question type supports it (short answer and paragraph do). For other types, you may need to use a regular expression to combine conditions.
Frequently Asked Questions
Can I validate a multiple choice question?
No. Multiple choice, checkboxes, and dropdown questions do not have response validation options. Validation is only available for short answer, paragraph, and multiple choice grid questions.
How do I require an answer to be a valid email address?
Use the Regular expression validation type. Choose matches and enter the pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$. This ensures the answer looks like an email.
Can I set a minimum and maximum length at the same time?
Yes. Choose the Length validation type and select between. Then enter the minimum and maximum character counts. For example, between 5 and 20.
Does validation work on required questions only?
No. Validation works on any question that has it enabled, regardless of whether the question is required. If a question is optional but has validation, an empty answer is accepted (since it’s not required), but if the respondent enters something, it must pass the rule.
Can I use regular expressions to validate a phone number?
Yes. For a US phone number, you could use a pattern like ^\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}$. Adjust the pattern for your country’s format. Test the regex before adding it.
Why is my validation not working on the published form?
First, check that you are not in the editor. Open the live form link in a new tab. If it still fails, copy the form link and open it in an incognito window to rule out browser cache. Also, ensure the question is not a type that doesn’t support validation.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.