[英]Writing to Google Docs Spreadsheets using Apps Script
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. 我正在尝试将Apps脚本集成到我的网站(而不是Google网站)的订单页面中,以便可以将用户的订单写入Google Doc电子表格。 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.
我不知道该怎么做,因为Apps Script文档说Apps Script只能开发并嵌入到Google Sites Pages中。 Is there a way I can achieve this even though my site isn't a Google Site?
即使我的网站不是Google网站,有没有办法实现这一目标? I'll appreciate any help at all very much, thanks in advance.
非常感谢您的帮助,在此先感谢您。
You can write a regular HTML form (not in Apps Script) and set method='post' action='the script url'. 您可以编写常规的HTML表单(不在Apps脚本中),并设置method ='post'action ='script url'。 That will invoke your script with the data from the form passed into the doGet as parameters.
这将调用脚本,并将表单中的数据作为参数传递到doGet中。
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. 您的电子表格可以执行onFormSubmit操作(https://developers.google.com/apps-script/understanding_events),该操作可以对提交的数据进行任何您需要的操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.