I'm trying to find out which tab in the spreadsheet was last changed.
I have a google sheet with multiple tabs shared among multiple users. I can detect when a user makes a change like this:
def testChanges(self):
response = self.service.revisions().list(fileId='some-file-id').execute()
revs = response.get('revisions',[])
if not len(revs):
return
revID = revs[-1].get('id')
response = self.service.revisions().get(
fileId='some-file-id',
revisionId=revID,
fields='kind, id, modifiedTime, lastModifyingUser'
).execute()
And I get a response:
{
"kind": "drive#revision",
"id": "12",
"modifiedTime": "2018-09-17T20:10:41.330Z",
"lastModifyingUser": {
"kind": "drive#user",
"displayName": "USER NAME",
"me": true,
"permissionId": "08921584708523400585",
"emailAddress": "email.address@gmail.com"
}
Now I need to process the tab that the user just changed. How can I figure that out? I've checked Drive documentation and Sheets API, but so far no luck.