I'm trying to integrate Apps Script into my website's (not a Google Site) order page so that a user's order can be written to a Google Doc spreadsheet. I don't know how to go about this because the Apps Script documentation says Apps Script can only be developed and embedded in Google Sites Pages. Is there a way I can achieve this even though my site isn't a Google Site? I'll appreciate any help at all very much, thanks in advance.
-
as far as I see, this type of application is not possible with the help of apps scriptViral Shah– Viral Shah2012-09-14 05:28:32 +00:00Commented Sep 14, 2012 at 5:28
-
So how do you suggest it can be done, Viral?Nii Laryea– Nii Laryea2012-09-16 08:15:32 +00:00Commented Sep 16, 2012 at 8:15
Add a comment
|
2 Answers
You can write a regular HTML form (not in Apps Script) and set method='post' action='the script url'. That will invoke your script with the data from the form passed into the doGet as parameters.
2 Comments
Nii Laryea
I'm probably supposed to know this but how is doGet method used?
Jamie Kudla
Could you possibly elaborate on your answer with a link to somewhere or an apps-script snippet that allows you to write/read data from a spreadsheet?
You can create a data capture spreadsheet, and create a Form for it. You can "clone" the form (field names and form action) into your web site.
Your spreadsheet can have an onFormSubmit action (https://developers.google.com/apps-script/understanding_events) which does whatever you need with the submitted data.
2 Comments
Nii Laryea
What's a data capture spreadsheet and how do I create one. Also, how do I clone the form into my website?
pinoyyid
It's just a plain old google docs spreadhseet with a form (click 'form' on the menu bar to create a form). Once you've created the form, go to it ('go to live form') and then look at the source code. You just need to replicate the field names (all of them) and form action in any HTML within your site.