2
我发现这种方法存储数据从HTML [链接] Add basic data to a Google Spreadsheet via a simple HTML Form,但这种方法发送数据不按顺序。我想送的指令和数据只有一些变量 我有这个HTML文件只发送一些变量到电子表格从一个HTML表格
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<form id="form" method="get" action="https://script.google.com/macros/s/AKfycbzhVAFaP7tFTbSzgeO0y9rUBl6ptVRCbqpS9wi12yFmoboYjw/exec" accept-charset="UTF-8">
Name and age!
<input type=text name=name id=name>
<input type="text" name="direccion" placeholder="Direccion completa">
<input type=number name=age id=age>
<input type="Apellido" name="Apellido" id="Apellido">
<input type=submit onclick=google.script.run.addProduct()>
</form>
</body>
</html>
而且我在我的电子表格这种code.gs
function doGet(e){
var vals=[];
vals.push(new Date());
for(var i in e.parameter){
vals.push(e.parameter[i]);
}
SpreadsheetApp.openById("1KYR7SefLy5P-JP3LqdKsRRd_bkwTHFGFQQ0rnD3JfUM").appendRow(vals);
return ContentService.createTextOutput("Información enviada correctamente");
}
有一些方法来发送变量订购?
你真棒:)谢谢,这解决了我的问题 –