The example here is a stripped down version that uses colours to determine which Google Drive folder ID should be selected from the Config sheet for the script to proceed. I have another example of the 'switch' process in this blog post on getting a weekday name from a date.
Screenshot of Google Form question |
The switch iterates through each case to determine a match against the colour selected from the Google Form. If one is found it then updates the parentFolderId variable with the value from the Config sheet. This can then be used to get the relevant folder and proceed with the rest of the script:
var parentFolderId = '';
switch (colour[0]) {
case 'Red':
parentFolderId = redFolderId;
break;
case 'Blue':
parentFolderId = blueFolderId;
break;
case 'Green':
parentFolderId = greenFolderId;
break;
}
Google Form - use a switch to determine save location
No comments:
Post a Comment