March 2016
Beginner to intermediate
232 pages
4h 29m
English
To enhance the Order form, update the doGet function as follows:
function doGet(){
var template = HtmlService.createTemplateFromFile("Order");
template.pricelist = getPrice();
var html = template.evaluate();
return HtmlService.createHtmlOutput(html);
}The price list is assigned to the template as a 2-dimensional array and is returned by the function shown here:
function getPrice(){
var data = SheetStock.getDataRange().getValues();
// remove header row.
data.shift();
return data;
}In the Order.html file, update the select tag markup as shown in this code snippet:
<td> <select id="item" name="item"> <? for(var i in pricelist){ ?> <option value="<?= pricelist[i][0] ?>" > <?= pricelist[i][0] ?></option> <? } ?> </select> </td> ...Read now
Unlock full access