I want to create a form on my site that when a user submits, it posts their data to a particular Spreadsheet in my Google Drive. How can I do this with Google App Scripts?
sample form
<form method='post' action='https://script.google.com/macros/s/xxxx.....'> Favorite Color <input type='text' value='' name='color' /> Favorite Ice Cream Flavor <input type='text' value='' name='flavor' /> <input type='button' value='submit' /> </form> so that when I hit submit it creates a record in a Google Drive Spreadsheet
| color | flavor | red vanilla Is this doable with GAS, or is sort of task more suited for the Google Drive SDK (via Javascript)?
UPDATE
Used the example from How to add form elements to UI App Service to complete the script
This is the current script I've thrown together... and it works!!!
var SPREADSHEET_ID = '0Aqa6DbU_0sv7dGNrMEEybjNrdm00MlpwTTNx...'; function doPost(e) { var app = UiApp.getActiveApplication(); SpreadsheetApp.openById(SPREADSHEET_ID).getSheetByName('RequestInvites').appendRow([e.parameter.emailAddress, 'hash123']); app.add(app.createLabel("Form submitted. Your email address is: '" + e.parameter.emailAddress)); return app; } function createForm(e){ var app = UiApp.createApplication(); var form = app.createFormPanel(); var flow = app.createFlowPanel(); flow.add(app.createLabel('Enter your email address to get an invitation').setId('inviteLabel')); flow.add(app.createTextBox().setId('emailAddress').setName('emailAddress')); flow.add(app.createSubmitButton("Request Invite")); form.add(flow); app.add(form); return app; }