Is there a way to trigger a spreadsheet’s onFormSubmit in script? That is, instead of using a google form to trigger onFormSubmit? I attempted the below sendHttpPost code posting to a spreadsheet Web App:
function sendHttpPostSelf() {
var payload = {
"name" : "name",
"comment" : "comment",
};
var options = {
"method" : "post",
"payload" : payload
};
var url="https://script.google.com/macros/s/AKfycbzlVoiDQMbLe4yliErDoNub6A0m3tijSfPAUMEBENgIikQnLQ_H/exec";
var resp=UrlFetchApp.fetch(url,options);
Logger.log(resp.getContentText());
}
The code correctly triggers doPost() in the spreadsheet Web App. But, the code does not trigger the spreadsheet’s onFormSubmit. Alternately, is there any way to script an onInsert trigger when inserting into a spreadsheet?