I'm wondering if there is a more efficient way to add Items to Google Forms with App Script.
My script is taking a long time and I'm wondering if there's anyway to add items more efficiently using an array or something rather than one by one. Here's the code I'm running...
function addFormItems() {
var startTime = new Date(); var form = FormApp.create("Test") form.setIsQuiz(true)
for (var i = 1; i < 100; i++) {
form.addTextItem().setTitle("Question number " + i).setHelpText("Hint: answer should not be more than a couple of words")
}
var endTime = new Date();
//Get runTime in seconds var runTime = (endTime - startTime)/1000;
Logger.log("runtime is: " + runTime)
}
Currently it takes quite a long time a minute to a minute and a half (odd thing is every time I execute I get a very different runtime not sure why that happens) Any thoughts on how to speed this up is much appreciated.
I searched Documentation and couldn't find anything about adding multiple items with one call.