How to prefill Google form checkboxes?

后端 未结 4 2071
[愿得一人]
[愿得一人] 2020-12-01 11:25

I have looked at the question \"Is it possible to \'prefill\' a google form using data from a google spreadsheet?\" and the code provided in the answer (thanks Mogsdad) work

4条回答
  •  时光取名叫无心
    2020-12-01 12:15

    There is a small issue in the script provided as the answer.

    var ss = SpreadsheetApp.getActive();
    var sheet = ss.getSheetByName("Form Responses 1");
    var data = ss.getDataRange().getValues();  // Data for pre-fill
    

    The variable data is referencing the active sheet (ss), not the "Form Responses 1" sheet (sheet). This could be intentional but I thought I should highlight it if anyone else is using the same sheet for pre-filling and responses.

提交回复
热议问题