Reputation:
I am looking to get the last modified username or name of the user that last modified a file on Google Drive. This is what I have:
while (trashedFiles.hasNext()) {
var trashedFile = trashedFiles.next();
var trashedName = trashedFile.getName();
var trashedURL = trashedFile.getUrl();
var fileID = trashedFile.getId()
var trashedUpdated = Utilities.formatDate(trashedFile.getLastUpdated(), timezone, "yyyy-MM-dd HH:mm");
var trashedCreated = Utilities.formatDate(trashedFile.getDateCreated(), timezone, "yyyy-MM-dd HH:mm");
//var LastModifiedBy = Drive.Files.get([fileID]).lastModifyingUserName();
var LastModifiedBy = Drive.Files.get([fileID]).lastModifyingUser();
}
I get this error: TypeError: Cannot call property lastModifyingUser in object
Thanks
Upvotes: 2
Views: 216
Reputation: 1403
Hope This will help:
https://developers.google.com/drive/v2/reference/revisions
Please find the property by the name : lastModifyingUserName
Let me know if I am mistaken.
Upvotes: 1