How to ask for user input in “on edit” installable trigger in Google Spreadsheet?

柔情痞子 提交于 2019-11-28 13:58:33

As a possible workaround, you can create separate sheet that will be your "form" for user input:

"Submit" button should be an image, assign function to it by context menu - "Assign script" (enter your function name to process "form" data):

Then your onEdit trigger should just activate "form" sheet for the current user when edit happened. Sample code:

function onEdit() {
  SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Form').activate();
}

After filling the form user clicks on "Submit" image, then you can send data to external service, sample code:

function submit() {
  var response = UrlFetchApp.fetch("http://www.google.com/");
  SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Results').appendRow([response.getResponseCode(), new Date()]);
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!