I'd like to create a form that uses the data from the spreadsheet, so that it's dynamic. Is it possible to do this? I haven't been able to find anywhere that describes how, or any examples.
All that seems possible is to populate a spreadsheet from a form, which I'll also use but its not the primary concern here.
Go to the Insert menu in Google Sheets, choose drawing and pick any shape. You can also add overlay text to the shape. Once the shape is placed on the spreadsheet canvas, click the menu, choose assign script and type populateGoogleForms . That's it.
That's great for quick form results, but for more tools to analyze answers, you can link your form to a Google Sheets spreadsheet. Just click the green Sheets icon in the Responses tab or click Select response destination in the menu, then create a new spreadsheet or select an existing one to store the answers.
“Form Builder for Sheets” helps you to build Google Form in a very simple and fast way by importing fields/questions/quiz from existing Google Sheets.
Google Apps Scripts.. finally a well documented way of generating Google forms programmatically. https://developers.google.com/apps-script/reference/forms/
Yes it is. Use a Form script and update the information from the spreadsheet using a trigger on the FORM OPEN. Here is an example that gets data from two different sheets and insert data in a combo box and into a multiple choice control.
function getNewNames(){
var form = FormApp.getActiveForm();
var items = form.getItems();
var ss = SpreadsheetApp.openByUrl(
'https://docs.google.com/spreadsheets/d/YOURDOCSNAMEHERE/edit');
var assSheet1 = ss.getSheetByName('Sheet1');
var assValues = assSheet1.getDataRange().getValues();
var values = assValues.slice(1);
var valSort = values.sort();
var ss2 = SpreadsheetApp.openByUrl(
'https://docs.google.com/spreadsheets/d/DOCSNAMEHERE/edit');
var playerSheet1 = ss2.getSheets()[0];
var playerValues = playerSheet1.getDataRange().getValues();
var player = playerValues.slice(0);
var plySort = player.sort();
var names = [];
for(var p = 0; p < plySort.length; p++){
names.push(plySort[p][0])
}
var pList = items[0].asListItem();
pList.setChoiceValues(names).setRequired(true).setHelpText('Please Select Player Name')
var areas = [];
for (var i = 0; i < valSort.length; i++) {
areas.push(valSort[i][1])
}
var aList = items[1].asMultipleChoiceItem();
aList.setChoiceValues(areas).setRequired(true).setHelpText('Select Area of Assessment')
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With