0

I would like a script in Google Sheets to move and possibly rename a file located on Google Team Drive. So far I have found out, that "move" isn't possible, it's "add the file (copy), then delete the original". But this only works on a regular Google Drive, not a Google Team Drive. What I have tried is

destinationFolder.addFile(file);
sourceFolder.removeFile(file);

but the first line gives me an error that "Team Drive doesn't support this function".

Rubén
  • 34,714
  • 9
  • 70
  • 166
Simon Gade
  • 111
  • 1
  • 5
  • Can I ask you about your goal of `I would like a script in Google Sheets to move and possibly rename a file located on Google Team Drive.`? In this case, you want to move only the container-bound script from Google Spreadsheet by separating from Google Docs to the shared Drive. Is my understanding correct? – Tanaike Jun 20 '20 at 01:13
  • Hi Tanaike, It's an external file (located on Team Drive) I want to move, not a script. It's a CSV file that my script imports and I then want moved to an "imported" directory. – Simon Gade Jun 22 '20 at 06:32
  • Hi Rubén, Yes, I got it working with that link! Thank you very much. Don't know why it didn't show up in my search… – Simon Gade Jun 22 '20 at 07:52

0 Answers0