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");
}
有一些方法來發送變量訂購?
你真棒:)謝謝,這解決了我的問題 –