Delete change history

I use Google Apps Script to run data encryption in a spreadsheet. It works fine, but this convenient history of changes to the table makes this a bit of a controversial question, how can you simply view the version before encryption.

Is there a way to delete version histories or just not create them together?

+8
google-spreadsheet google-apps-script
source share
5 answers

Not. The API drive for accessing change history does not delete entries in a Google sheet.

Something you need to know about the change history is only available to those who have edit rights. View or comment only rights can not see the history of changes.

One solution is for users to send data to a very narrow shared sheet via Google forms and set up a trigger to copy insensitive meta / aggregated data that you leave unencrypted for a more open sheet for access by unreliable users and scripts. the cell formula IMPORTRANGE () will also work, it gets access from the person entering the formula, and therefore can move data from a limited sheet of an expanded list to a less limited one without violating the original sheet.

The second solution, which is a little more cumbersome, but closer to your request, is to provide users and external scripts with access to the disk folder containing the sheet. With the folder script identifier, you can search for a sheet by name using drive api , users use their eyes to find them by name. Your encryption script, after encryption is complete, will copy the spreadsheet using SpreadsheetApp.copy (name) , which will copy all formulas, formatting, data, even scripts, but not the change history. Pass a copy () with the same name as the source sheet, the file names of the disks do not have to be unique. Use the api disk to move the new spreadsheet to the folder, it should inherit the default shared folder. Again with the disk API, delete the original table. Since all users and scripts searched for a file named X in a specific folder identifier, it is still exactly where they expect to find it, but the change history is gone.

+3
source share

Unfortunately, Google Apps Script does not provide a method to remove items from the change history.

0
source share

Copy the whole spreadsheet, restore it to the first version and then paste the spreadsheet :)

-2
source share

There is a good solution I found:
just follow these steps:

1. Copy the spreadsheet file
2. Delete first
3. Rename the second

I use this trick every day.

It works for all Google docs. Let me know if you used this.

-2
source share

For Google Docs, I managed to get rid of the change history by making a copy of the document. Not sure if this will work for spreadsheets either.

-3
source share

All Articles