Is it possible to generate different versions of a document with Google Docs? Is there any programming/scripting language associated that one can specify which text to show based on e.g. a cell's value in another spreadsheet?
Google-docs – Conditionally generated Google Docs documents
google docs
Related Topic
- Google-docs – Specify a default document template in Google Docs
- Google-sheets – Is it possible to link a cell in Google Spreadsheets to a Google text document? (not spreadsheets)
- Google Docs – How to Import Document Revision History into Git
- Google Docs – How to Disable Highlighting Commented Text
- Google-sheets – Formatting/ingesting text in Google Docs and Google Sheets
- Google-docs – Is Google Docs spell checking currently broken
- Google Docs – Create Shared URL to Anchor in TOC
- Google-drive – Google Drive vs Google Docs in doc conversion
Best Answer
The short is yes, you can retrieve documents using API calls, manipulate and retrieve the data, and create additional documents and directories in your Google Drive.
I believe it is even possible to grab previous 'revisions' of a document, if they are saved. As you may have noticed, there is a setting on each document that, by default, is set to keeping the latest revision. Previous versions are (I think) conditionally removed based on Drive space availability.
Generally, I'll start up a Google App Script project (https://developers.google.com/apps-script/) within a Google Site https://sites.google.com .. (create a site, and select manage site, select App Script menu on the left, and then select Add Script on the top section).
There are quite a few designations as starter project apps.. what's important to note is that this App can become a Gadget for your pages in the site.
EDIT - Sample Google Script App (Script as Web App)
I'm going to include some sample code of a completed 'dealer registration' web service and form I completed for a company I briefly worked for.
This script will open and modify an excel spreadsheet. mailing a notification to a specified email address using either the user accessing the app, or the designated user (depends on your app conifguration).
It attempts to load the excel sheet (in edit mode) by id, it's a good point of reference for your question and this answer.
Disregard the 'Creates a spreedsheet inline comments'. it doesn't attempt to create the excelSpreedsheet in this implementation; you could, of course, use the existing function to create it programmatically.. I just didn't see a point to checking for the existence of the file, as I already know it exists.
you can get the ID of a spreadsheet by looking it up in your google docs, or opening it up and reading off the hash (looks like "129o71gM0zpCnp0NX-mCr_A1oSBbse8heLDK5wU2mfQM").
Code.gs
registry-form.html