The installable trigger is not created using "ScriptApp.newTrigger"

0

I have created two scripts in Google Apps Script for the same purpose in standalone , in order to create a trigger Installable in a spreadsheet, but after executing the code, I can not see the trigger in the code editor interface of the sheet.

First option:

var ss = SpreadsheetApp.openById("1gcO5jsX5j53WQz6xxxxxxxxxx9gfWRs5zTlc");

var myTrigger = ScriptApp.newTrigger("onFormSubmit")
 .forSpreadsheet(ss)
 .onFormSubmit()
 .create();

Second option:

var myTrigger = ScriptApp.newTrigger("onFormSubmit")
 .forSpreadsheet("1gcO5jsX5j53WQz6xxxxxxxxxx9gfWRs5zTlc")
 .onFormSubmit()
 .create();

Why is this happening?

    
asked by Ignacio Baixauli 18.05.2017 в 21:47
source

1 answer

0
  

Note: This is a partial response that includes content that is usually published as a comment, but has been published as an answer, as an exception for the extension and format.

The data provided in the question is not enough to know what is happening.

  • Missing if the script named onFormSubmit was created because the newTrigger only creates the trigger, not the script.
  • Missing if it has been verified that the script to be called by the trigger runs without problems.
  • Missing if an error message occurs or not.
  • answered by 19.05.2017 в 13:54