1
votes

Under the same account, we create client Google Sheets from a template we store within Google Drive.

On a regular basis, we make a take a few actions and make changes to the Sheets. These include:

  • File-Make a Copy

  • Rename Sheet and move to the "Client" folder

  • Make small edits to a few lines in Google App Script within the Sheet

  • Setup 3 triggers with permissions to execute on change, edit etc

Takes around 3-4 minutes but we do quite a few per day.

Can these actions be automated via Drive API or perhaps Google Cloud Functions? The project runs alongside AWS Lambda, so that is also an option too as we have used gspread before to work remotely with Sheets. But as far as I am aware making copies, triggers and app script are not available via API or other means.

1
You can have a stand alone Apps Script file do all these things, and if you need to trigger the code to run from somewhere external to Apps Script, you can add a doGet() or doPost() function to the Apps Script code and trigger one of them with an HTTPS GET or POST request to the URL of the published web app. So, create a stand alone Apps Script file. Publish it as a web app. Get the URL of the published web app, and from an external source make a GET or POST request to that URL. The code will run, and do whatever you want/need it to do.Alan Wells
Great answer, thanksuser7915679

1 Answers

0
votes

But as far as I am aware making copies, triggers and app script are not available via API or other means.

You can do all that and more just using Apps Script. Read through the guides provided as part of documentation:

https://developers.google.com/apps-script/overview