Google Script - Move new submissions to another sheet based on the responses

谁说我不能喝 提交于 2019-12-01 01:13:28

I have a spreadsheet that collects the form submissions and then has extra sheets that have filtered out these submission based on the answers. All this is just with formulas. Could that do the trick also?

Try something a little less broad in your comparing of variables,, For instance the sheet that submissions are sent to is a constant and already address.

function formSubmission() {
 var s = SpreadsheetApp.getActiveSheet();
 var data = range.getValues(); // range is a constant that always contains the submitted answers
 var numCol = range.getLastColumn();
 var row = s.getActiveRow;
 var targetinfo = s.getRange(row,(Yourcolumn#here).getValue);
    if(targetinfo() == "Desired Sheet Name") {
      var targetSheet = ss.getSheetByName("Sheet A");
      var targetrow = targetSheet.getLastrow()+1);
      var Targetcol = numCol();
      targetSheet.getRange(targetrow,1,1,Targetcol).setValues(data);
     }
  }

I didn't test that but hopefully it helps look up Event Objects in the developer guide i just recently found it and it clarifies a lot

the triggers can be set by going to:

then set it:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!