-
-
Save anonymous/7c2e2ba5251b38f01fe5bca98a55ab6d to your computer and use it in GitHub Desktop.
bound Forms script to limit responses
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To create a bound script, open a Google Sheets, Docs, or Forms file, then select Tools > Script editor. | |
// Steps to make this function run on form submit: | |
// https://developers.google.com/apps-script/guides/triggers/installable#managing_triggers_manually | |
function lockOnFull(e) { | |
// Get the form to which this script is bound. | |
var form = FormApp.getActiveForm(); | |
var formResponses = form.getResponses(); | |
// room has 11 seats. Limit to 11 responses. | |
if ( formResponses.length > 10 ) { | |
form.setAcceptingResponses(false); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment