I am working on a script that requires html form data to be inputted to a web app, I then want to be able to process that form data and put it on a google sheet. The thing is I can't seem to do that. Here is my code:
Index.html
<form id="Form" onsubmit="event.preventDefault();
google.script.run.getData(this)">
<input type="text" name="firstname">
<input type="submit">
</form>
Code.gs
function getData(data) {
var sheet= SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Logs');
sheet.getCurrentCell().setValue(data.name);
}
What am I doing wrong?
CodePudding user response:
Output:
- In this example, my current active cell is in
A1