将电子表格中的特定工作表设置为表单目标

问题描述 投票:0回答:1

我正在与GAS合作进行大学项目,但遇到了麻烦。我将带有某种逻辑的电子表格设置为表单的目的地(我需要处理来自表单的数据)。

这是我的代码:

  // Create the form from a template in the folder just created
  var formFile = formTemplate.makeCopy('questionario', newFolder);
  var form = FormApp.openById(formFile.getId());

  // Create the spreadsheet from a template
  var repliesFile = responseTemplate.makeCopy('risposte', newFolder);
  var replies = SpreadsheetApp.openById(repliesFile.getId());

  // Set the destination spreadsheet for form replies
  form.setDestination(FormApp.DestinationType.SPREADSHEET, replies.getId()); 

我的问题是表单答复在电子表格内创建了一个新工作表,因此我的逻辑不适用于来自表单的数据。

有任何建议吗?有没有一种方法可以将数据放入我想要的工作表中?如果没有,您可以建议任何解决方法吗?谢谢大家

reply spreadsheet image with the two sheet, mine and the one created by the form

google-apps-script google-sheets google-form
1个回答
0
投票

无法将工作表设置为表单响应的目标,因为只有一种方法可以设置表单目标:

setDestination(type,id)

参考

© www.soinside.com 2019 - 2024. All rights reserved.