Using onChange trigger on google sheets script -
i running script in google sheets script editor, trigger script use onchange in current project's triggers, using specific function -> spreadsheet -> on change.
important mention use sheet 3 more members have edit permission change time time data, built script , activate trigger.
when change in sheet alerted (the trigger on) when other member changes data trigger doesn't work.
what have missed here?
thanks.
everyone needs trigger
you can add trigger management program have triggers in projects too. istrigger() function insures create 1 trigger each instance. find documentation here.
function mytriggersetup() { if(!istrigger('functionname')) { scriptapp.newtrigger('functionname').forspreadsheet('spreadsheet').onchange().create(); } } function istrigger(funcname) { var r=false; if(funcname) { var alltriggers=scriptapp.getprojecttriggers(); var allhandlers=[]; for(var i=0;i<alltriggers.length;i++) { allhandlers.push(alltriggers[i].gethandlerfunction()); } if(allhandlers.indexof(funcname)>-1) { r=true; } } return r; }
Comments
Post a Comment