Best deployment method for Google Sheet to create templated documents

Viewed 34

I'm building an app that takes key information from a completed Google Sheet checklist and creates various documents from it when a button is clicked, mapping the data to several Google Documents. I'm now struggling to find the best way to deploy the app.

At the moment the script is just held within a Checklist spreadsheet (Container-bound), which means that the user is asked to grant permission when the documents need to be created. This would be fine if this only needed to operate in a single checklist spreadsheet, but there is a copy of the checklist file for every client we have, so the current setup would require permissions to be granted for every one.

I'm trying to get it so that the user only needs to grant permissions to the script once, or for the script to always be run using permissions granted by a specific "Bot" user.

Would this be best to deploy as a Sheets Add-On, a Web App, or just a Standalone script? If it was a Web App or Standalone script, how would the spreadsheet call the functions?

1 Answers

It will depend on what you are doing on the spreadsheet.

The simplest way of doing it is having an empty template that you make a copy every time you need to enter a client. Making a copy of a spreadsheets will also copy the bound Apps Script project.

The other –fancier– way is having a WebApp which have a doGet that shows a HTML form where you may add all the different data. It should have method="post" so then you can use doPost to generate the files and list them to the user. This is allows you to make a tailor-made interface.

Related