0
votes

I've got a web app (deployed from a stand-alone script) that creates a new GSheet and GForm and then links the form to the sheet to store the responses.

What I would like to do is create an "on form submit" trigger from within the web app that fires on a form submission; get the whole thing working with one-click on the web app. I can create the trigger in the web app script but nothing happens on form submission, I have to create it from the script contained in either the new sheet or form for that - two clicks!

Would one-click be possible??

I could do this with an add-on but they aren't allowed on this particular domain.

Here's the question on the GAS+ forum.

1

1 Answers

0
votes

I'm not exactly sure what you need, but I think this is what you want:

function onSubmitTrigger(){
 //psuedocode(ish)
       /*
1.Get range of values
2.Find last submitted value
3.Pass value to function "onSubmit"

Or just run a function and skip passing a value
        */        
}
  function onSubmit(e) {
     //Run whatever you need to run
 }

You can set the trigger within the actual service: Click on the clock icon: Clock Icon

Then go ahead and set up a new trigger: Set up

Select the function onSubmitTrigger() and you can set it up to run as the form is submitted: Set-Up

BTW: you can map a image on the spreadsheet to run a function if that is easier for you..