Reputation: 1162
To get the date a file was last updated you can call getLastUpdated()
How to I get the user who did this last update in google apps script code?
I have tried to run the code under listing revisions at Advanced Drive Service
var revisions = Drive.Revisions.list(fileId);
but I get
ReferenceError: "Drive" is not defined.
Upvotes: 4
Views: 6513
Reputation: 21
To make it clear:
First enable the drive API and SDK as described by Bryan P. Then you can use
var lastemailuser = Drive.Files.get(<FILEDID>).lastModifyingUser.emailAddress;
var lastnameuser = Drive.Files.get(<FILEDID>).lastModifyingUserName;
Upvotes: 1
Reputation: 5051
https://developers.google.com/apps-script/guides/services/advanced
In Resouces > Advanced Google services, turn on Drive API...
In that same window > click Google Developer's Console >> enable both Drive API and Drive SDK...
then...
Drive.Files.get('<FILEDID>').lastModifyingUser
Upvotes: 8