7

I'm running a script on a google spreadsheet, that should be triggered by the onChange() event (when a new row is inserted in the spreadsheet) by a zap from Zapier (www.zapier.com). I can see the new info being created in the spreadsheet, but the trigger is not triggered. I already tested with the onEdit() event, but it's not working. It should not be a time-based trigger.

Any suggestions?

Rubén
  • 34,714
  • 9
  • 70
  • 166
siramthar
  • 71
  • 1
  • 1
  • 2

2 Answers2

2

I'm getting data from external api (in my case IFTTT) and by using below function, I'm triggering a url fetch function to send data (the last Row) to another external api ( my own website). Working perfectly.

 function onChange(e) {
var ss = SpreadsheetApp.getActive();
ScriptApp.newTrigger('name of the function you need to trigger')
.forSpreadsheet(ss)
.onChange()
.create();
}
1

If you have not set up the trigger in the script:

Go to resources menu, and select 'current project triggers'. you should be able to set up your script to run 'on change'.

Jeremy Beard
  • 2,727
  • 1
  • 20
  • 25
Auto Mat
  • 69
  • 6
  • 1
    I did create a trigger, but id did not run. It actually crossed my mind that the name of the script should be different than the name of the event. (I am using onEdit() ... script but then, I can use the trigger to do run onEdit() when onChange occurrs? – siramthar Mar 15 '15 at 18:08
  • 1
    added the trigger, but doesn't run. Any other suggestions? – siramthar Mar 17 '15 at 02:52