I've read all the documentation on Installable Triggers and questions here on StackOverflow, but the triggers simply do not run based on the installer's permissions. They run based on the permissions of whoever makes the modification in the spreadsheet thus triggering grab_info
.
According to the documentation: They run as the user who installed the trigger, not as the user triggering the event.
So I've been manually deleting the triggers, reloading, running the trigger creator below, and then reloading the spreadsheet. While still logged in the trigger works fine, then after I log out, the trigger doesn't work. It's functioning under the current user, not the installer.
Am I doing something wrong?
Here's my trigger creation code below:
function add_trigger() {
ScriptApp.newTrigger('grab_info').forSpreadsheet(SpreadsheetApp.openById('blahblah')).onEdit().create();
}
Edit:
This is the code that is currently failing:
function grab_info(){
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var i = sheet.getActiveCell().getRow();
var date = ss.getRange("C" + i);
var due_date = 'test';
date.setValue(due_date);
}