in Google drive, I am trying to copy a folder from a personal account (Account A) to a corporate workspace account(Account B).
I am trying to run the script, credit to ref
/**
* Entry point to execute with the Google Apps Script UI
*/
function copyFolder() {
// Get the folders (by ID in this case)
sourceID = "xxxxxxxxxx"
targetID="xxxxxxxxx
const toCopy = DriveApp.getFolderById(sourceID )
const copyInto = DriveApp.getFolderById(targetID) //error in this line
// Call the function that copies the folder
copyFolder_(toCopy, copyInto)
}
I am trying to run this script as the user in account A. Error as follows.
Exception: No item with the given ID could be found. Possibly because you have not edited this item or you do not have permission to access it.
The reason is targetID
ref to a folder in Account B.
How to grant the ACCOUNT A user the right to put something in ACCOUNT B?