Reputation: 21
I want to make google form quiz by importing spreadsheets using google apps script. I want to replace 'Cell A2' -> spreadsheet's A2 and 'Cell B2 -> spreadseet's B2. please help me.
var item25 = form.addMultipleChoiceItem();
item25.setTitle('Cell A2')
item25.setChoices([
item25.createChoice('Cell B2'),
item25.createChoice('Cell B2')
])
Upvotes: 0
Views: 76
Reputation: 26796
Sample:
var sheet = SpreadsheetApp.openById("paste here the id").getSheetByName("Sheet1");
var value1 = sheetgetRange("A1").getValue();
var value2 = sheetgetRange("B2").getValue();
var item25 = form.addMultipleChoiceItem();
item25.setTitle(value1)
item25.setChoices([
item25.createChoice(value2),
item25.createChoice(value2)
])
Upvotes: 1