0
votes

I have created a Google Apps Script. It is a Web form which is deployed as a web application. I can successfully put it on Google Sites page. Anonymous users can go to my Google Sites page and can view/fill-out and submit the form and it writes to my Google sheet with no issues.

My permissions settings follows:
"Execute the app as:" = "Me([email protected])" and
"Who has access to the app:" = "Anyone even anonymous"

So I want to distribute the form to other Google Sites webmasters so they can use it on their Google Sites Page. But I want it to be their form writing to their own spreadsheet.

The following option is not available:

"Execute the app as:" = "User installing the web app" and
"Who has access to the app:" = "Anyone even anonymous"

Can anyone think of a way that a developer could distribute this type of work to others that would be less clunky than a copy/paste solution and a related tutorial on making their own Google Apps Script with the developers code.

In a perfect world this code would be distributed with a link and the code would be hidden from Mr. code thief.

Any ideas?

1

1 Answers

1
votes

what you want isnt supported. to reuse your code the user must use a copy of your script, which needs to be deployed again.

there are a few things to make the process easier:

  1. make an apps script library to consolidate as much code as possible. this simplifies later updating the code for all mr. coders, and makes the copies hsve little code.

  2. put the script (which uses the library) inside a google spreadsheet. add sheet menus that show instructions and verify that the user published correctly. verifying can be done by checking if the script has a published service url and make it easily available from the menu.

  3. make a google sheet template out of your spreadsheet. with this, mr. coders will get a copy by just clicking the "make copy" button. it will copy the sheet, code and menus.

all three steps are used and explained with sample sheets and code in this blog post of mine: http://zigmandel.blogspot.com/2015/09/how-i-crowd-translated-my-product-tour.html

there you can copy the sheet and have a working sample with a sheet, code, library and menu.

note that the missing step of publishing the script can't be automated. the coder will have to enter the script editor and do it following your instructions.

sheet menus work before the user publishes the script and will also prompt for any authorzations needed. in the end, the sheet provides a single place to contain the script and instructions in a single page, make copying and deploying the code easier.