我遇到以下代码的问题:它应该将两个现有模板(1个表单及其响应spreadshit)复制到共享文件夹中。当我尝试将复制的表单的目标设置为复制的响应模板时,会出现此问题。它告诉我spreasheet ID存在问题。
你知道这是什么问题吗?
-----------------------------------------------
//Copying the Form Template
var templateForm = DocsList.getFileById(templateFormId);
var copyForm=DocsList.copy(templateForm,company);
var copyFormId = copyForm.getId();
copyForm.addToFolder(formFolder);
copyForm.removeFromFolder(rootFolder);
//Copying the Responses spreadsheet template
var templateRep = DocsList.getFileById(templateRepId);
var copyRep=DocsList.copy(templateRep,company+" - review");
var copyRepId = copyRep.getId();
copyRep.addToFolder(repFolder);
copyRep.removeFromFolder(rootFolder);
//Modifiying the copied Form
var form = FormApp.openById(copyFormId);
form.setDescription(description);
form.setConfirmationMessage('Thanks for reviewing the company '+company+"!");
form.setDestination(FormApp.DestinationType.SPREADSHEET, copyRepId);
答案 0 :(得分:1)