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?