March 2016
Beginner to intermediate
232 pages
4h 29m
English
To submit data using the google.script.run API methods, add onclick property to the Submit button:
<input type="submit" value="SUBMIT" onclick="google.script.run.postFormDataToSheet(this.parentNode);" /> <!-- this.parentNode is the 'form' element -->
Create the postFormDataToSheet function as shown here:
function postFormDataToSheet(e){
// Replace with your spreadsheet's ID.
var ss = SpreadsheetApp.openById("spreadsheet's id");
var SheetResponses = ss.getSheetByName("Responses");
// Create a 'Responses' sheet if it does not exist.
if(!SheetResponses){
SheetResponses = ss.insertSheet("Responses");
}
SheetResponses.appendRow([e.places]);
}To show Form submission result or error message, insert the postData ...
Read now
Unlock full access