I am trying to use a script that creates a Parent folder and subfolders and also copies any templates within a drive
- In line 136 you have to change the variable name
templateDocId
totemplateFolderId
this way:
var templateFolderId = data[i][1]
- After the line 152 the code should look like this:
// copy the template doc into the new directory (if specified)
// if(templateDocId != '') {
// makeCopy(templateDocId, newFolderId, newFolderName ' Template Document');
// }
if (templateFolderId != '') copy_files(newFolderId);
function copy_files(newFolderId) {
var src_folder = DriveApp.getFolderById(templateFolderId);
var dest_folder = DriveApp.getFolderById(newFolderId);
var files = src_folder.getFiles();
while (files.hasNext()) files.next().makeCopy(dest_folder);
}
After that the script will copy all the files from template folders into the new created folders (like 'Team A1', 'Team A2', etc).
The sheet with the changed script is here.