This Google Apps Script code will automatically close a Google Form when it reaches a maximum number of responses. It will also send an email notification to the form owner when the limit is reached.
- Open your Google Form.
- Click on the three dots in the upper right corner.
- Click on "Script editor".
- Copy and paste the code from the
code.gs
file into the script editor. - Save the script.
- Set the
maxResponses
variable to the number of responses you want to allow before closing the form. - Set the
ownerEmail
variable to the email address where you want to receive notifications. - Save the script again.
- Set up a trigger for the
onFormSubmit
function to run when a form response is submitted. - Test the form by submitting responses until the limit is reached.
- Have great success! (you have successfully limited the number of responses on your Google Form wihthou any additional paid service :-).
Related links (found during publishing Gist)