Ethan Carlton
Ethan Carlton

Reputation: 45

Google Apps Scripts - Exception

function moveFiles(sourceFile, targetFolder) {
  var file = DriveApp.getFileById(sourceFile);
  var folder = DriveApp.getFolderById(targetFolder);
  file.moveTo(folder);
}

When running this code i am getting the error:

Exception: Invalid argument: id moveFiles @ Code.gs:16

I have turning off disabling Chrome V8 runtime. However throws up a serer error. Thanks in advance.

Upvotes: 1

Views: 334

Answers (1)

Ethan Carlton
Ethan Carlton

Reputation: 45

Fixed, the File ID I was feeding the script was incorrect.

Upvotes: 0

Related Questions