I have created a function in script so that when a user completes a form, the answers go to a spreadsheet, a macro is generated (in script) that I send a doc attached in an email to the user with specific data. I can save this document in my personal Drive but I would need to save it in a shared drive. Is there such a possibility?
I leave here the code to see if anyone can think of it.
var FOLDER_NAME = 'Consulta_Fichero_Usuarios';
var file = DriveApp.getFileById(doc.getId());
var folder = DriveApp.getFoldersByName(FOLDER_NAME);
folder.next().addFile(file); //Lo añade a la carpeta especificada
DriveApp.getRootFolder().removeFile(file); //Elimina el archivo de donde venía