根据 Google 表单响应 sheet 中的单元格值移动行

Move row based on cell value in Google Forms response sheet

我有一个 Google Spreadsheet 和 2 sheets(研究结果和表格响应)。我正在尝试编写一个脚本,以根据研究结果 A 列中的单元格值,在每次提交新表格时自动将新答案从 Google 表格移动到研究结果 sheet sheet 与表单响应 sheet.

的 B 列中的单元格值相匹配

我只想将 D 列中的表格答案转移到 J 列,而不是表格 sheet 中的所有列。

我曾尝试在此处搜索类似的问题和脚本,但没有找到成功的脚本。老实说,我不完全确定这是否可行,但我只是想看看是否有人知道自动执行此操作的方法或有任何一般建议。

移动研究结果的答案

function onFormSubmit(e) {
  const ss = SpreadsheetApp.getActive();
  const sh = ss.getSheetByName("Study Results");
  let a = e.values;
  a.shift();
  sh.appendRow(a);  //Puts all of the answers into Study Results sheet.  If you want in a different order then explain that order
}