// TODO Before you start using this sample, you must run the setUp() // function in the Setup.gs file. // Application constants const APP_TITLE = "Upload files to Drive from Forms"; const APP_FOLDER_NAME = "Upload files to Drive (File responses)"; // Identifies the subfolder form item const APP_SUBFOLDER_ITEM = "Subfolder"; const APP_SUBFOLDER_NONE = " "; /** * Gets the file uploads from a form response and moves files to the corresponding subfolder. * * @param {object} event - Form submit. */ function onFormSubmit(e) { try { // Gets the application root folder. var destFolder = getFolder_(APP_FOLDER_NAME); // Gets all form responses. let itemResponses = e.response.getItemResponses(); // Determines the subfolder to route the file to, if any. var subFolderName; let dest = itemResponses.filter((itemResponse) => itemResponse.getItem().getTitle().toString() === APP_SUBFOLDER_ITEM); // Gets the ...
Posts
Showing posts from December, 2022