Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I name the current version of a Google spreadsheet, document or presentation using Google Apps Script?

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.

like image 687
a-burge Avatar asked Nov 08 '19 21:11

a-burge


People also ask

How do I get the current sheet name in Google Sheets?

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.

What is the Google version of spreadsheet?

Google Sheets: Online Spreadsheet Editor. Google Workspace. An integrated suit of secure, cloud-native collaboration and productivity apps powered by Google AI.

How do I find the version of my spreadsheet?

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.


1 Answers

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.

like image 177
Jescanellas Avatar answered Sep 22 '22 10:09

Jescanellas