Screenshot of transfer tool requirements |
A 'while' loop is used to cycle through and 'getFiles' in the first instance. From here we can get the email address of the current owner:
var currentFileOwner = file.getOwner().getEmail();Using an 'if' statement we can then look for a match with the current owner specified on the Welcome sheet and if one is found the new owner can be set:
if (currentFileOwner == currentOwner) {The process can then be repeated for sub-folders ('getFolders') which at the end we pass this folder ID back into the Function (hence creating a loop).
file.setOwner(newOwner);
}
Bulk change ownership of Google Drive items
No comments:
Post a comment