Change in spreadsheet.copy() behavior: Copied files are no longer saved in My Drive root

Hi everyone,

I’ve been using Google Apps Script for a while, and I recently noticed an unexpected change in how the spreadsheet.copy() method behaves.

The Issue: I have a simple script that copies a template spreadsheet. Until recently, executing this script would automatically create the copied file in the root of “My Drive”.

However, when I ran it today, the file was not created in My Drive. Instead, it seems to be created in an unknown location (I suspect they are being created as orphaned files without a specific parent folder).

Here is the code I am using:

JavaScript

const download_template = SpreadsheetApp.openById('/* spreadsheetID */');
const copyFiles = download_template.copy('Budget_Tool_v1.00');

My Questions:

  1. Has there been any recent specification change or undocumented update regarding the default destination folder for the spreadsheet.copy() method?

  2. Is this a known bug, or is anyone else experiencing the same issue?

(Note: I am aware that using DriveApp.getFileById(id).makeCopy(name, destinationFolder) is the best practice to explicitly set the destination. However, I have several legacy scripts using SpreadsheetApp.copy() and would like to understand the root cause of this sudden change.)

Thank you in advance for any insights or information!

I ran the exact same script again today, and the copied file was successfully created in the root of “My Drive”, just like it used to. I didn’t change any code.

It seems this was likely a temporary glitch or a transient issue on Google’s end.