Save doc sent by mail created by script in shared unit

1

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 
    
asked by Francisco Lopez 08.08.2018 в 16:34
source

1 answer

1

Google Drive does not have shared drives in the sense of Windows shared drives and other platforms. It could be a shared folder or a unit of equipment that in English are called "team drives".

Notes:

  • Team units are only available to be created by G Suite accounts that have this possibility enabled.
  • Some operations with team units require the use of the advanced Drive service (linked page in English ).
  • The included script already places the file in a folder. If that folder was shared, you could already have what you're looking for, and if what you're referring to is using a folder in a computer unit, the same script could serve you.

        
    answered by 08.08.2018 в 19:34