简体   繁体   中英

Google script: set form destination to an existing spreadsheet

I have an issue with the code below: it is supposed to copy two existing template (1 form and the its responses spreadshit) into a shared folder. The issue appear when I try to setDestination for the copied form to the copied response's template. It tells me that there is an issue with the spreasheet ID.

Do you have any idea what is the issue?

-----------------------------------------------
  //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);

Found out it was a google issue.

https://code.google.com/p/google-apps-script-issues/issues/detail?id=3700

It has been apparently solved.

Thank you/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM