1
votes

I am trying to create an onEdit(e) trigger through Google App Script, however, when going to Edit -> Current Project Triggers -> Add Trigger -> "Event Source" I DO NOT get the option to select "From Spreadsheet".

I simply like for this function to execute when there is an edit made to a cell on Google Sheets.

I have already tried creating an Installable Trigger (myOwnEditTrigger) through the G-Suite Developer Hub, however, I am forced to select "From Calendar" or "Time-Driven" event source, neither of the two are helpful for my project.

I am also trying to avoid programming the trigger through (.gs) code. If that is my only option, then where can I find the contents of this code?

I am expecting the the return value of parameter 'e' from onEdit(e) to return a Spreadsheet containing the edited data as described under "edit" on this page https://developers.google.com/apps-script/guides/triggers/events

2
Are you in the code editor for the Form or for the Spreadsheet.Cooper
You can't manually install an "On Edit" trigger from the G-Suite Developer Hub from a stand alone Apps Script project. And if you view all your triggers from all projects, there is no option in the G-Suite Developer Hub to manually install a trigger. I just tested programmatically installing a trigger to a spreadsheet file that I own from an Apps Script file that isn't bound to that spreadsheet, and it worked. I made an edit to the Sheet, and it ran the function in the stand alone script file.Alan Wells

2 Answers

0
votes

From a Spreadsheet, go to tools > script editor

and then write a script like

onEdit(e){
Logger.log(e);

}
0
votes

From the Google Developer Hub (https://script.google.com) we can only add Spreadsheet triggers to bounded to spreadsheet projects / projects contained by a spreadsheet.