I'm trying to give the current version of a Google spreadsheet a name using Google Apps Script. In the GUI I would do File -> Version history -> Name current version
but since I need to do this to multiple files, I want to achieve this using a script.
I've found the revisions reference but that's not helping much.
This question touches on a similar topic, but I've found the revisions.items.splice(-1) doesn't always list the current
version but rather the latest version.
To get the name of the currently active sheet, we need to first get a reference to the spreadsheet. Then we use the getActiveSheet() method of the Spreadsheet object to get the sheet that is active. Finally, we use the getName() method of the Sheet object to get its name.
Google Sheets: Online Spreadsheet Editor. Google Workspace. An integrated suit of secure, cloud-native collaboration and productivity apps powered by Google AI.
Go to File > Info > Version History. Select a version to open it. If you want to restore a previous version you've opened, select Restore.
This is not possible to do at this moment. I've found a similar Feature Request. You can click on the star next to the issue number to give more priority to the request and to receive updates.
It's not exactly the same but since it's asking for API support, "update the revisions" would presumably be supported too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With