0

I have a Google Spreadsheet document template **template** with multiple sheets, that I copy to a new file using my webserver and the Google APIs, before adding data inside some of the sheets (the other sheets contain for exemple formulas, that I do not want to alter programmatically). Suppose I have empty RAW sheets, and FORMATTED sheets with headers and formulas importing data from the RAW sheets.

If I need to udpate the RAW data of the same file : I just overwrite my data using drive_service.update_values and everything was cool so far since the FORMATTED sheet did not change.

But suppose I update the FORMATTED sheets of my template, and would like to propagate this to my generated files. In order to do this, what comes to my mind, is to make a new file from the updated template **template** (v2) So that I automatically get all the correct FORMATTED (v2) sheets, and add my RAW data as I usually do. However, I end up with two files that I'd like to merge into a single one, using the revision system.

Note that I do not control the number/names of Formatted sheets, so I cannot just replace/create a sheet on my application-side, it would not be maintainable

To sum up, I need to add a revision to an existing Google Spreadsheet file, whose content is (a copy of) a different Google Spreadsheet file, to which I need to add raw data using update_values.

What are the operations I need to do to achieve this ? I am programming in Ruby but I just need to know what operations I need to do with the drive API, and I can probably figure out how to do it in Ruby on my side, hence I'm not adding the Ruby tag

EDIT

I am working with Google Drive APIv3 and the Sheets APIv4, and I'm open to any newer version / other libs in case.

Cyril Duchon-Doris
  • 12,964
  • 9
  • 77
  • 164
  • Have you checked this SO [related post](https://stackoverflow.com/questions/26180902/how-can-i-get-the-revision-history-in-google-docs-using-a-script)? – Jessica Rodriguez Dec 06 '18 at 09:50
  • @jess the link you posted is a question about using a google script, but I am using the Google APIv3 from a web server, I believe this is quite different ? – Cyril Duchon-Doris Dec 07 '18 at 18:42

0 Answers0