简体   繁体   English

使用Apps脚本写入Google Docs电子表格

[英]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.

相关问题 在项目中使用Google Apps脚本功能 - Use Google Apps Script functions in project Google Apps脚本使用功能写入HTML - Google Apps Script write to HTML with Function 如何在我的 Google Forms 中添加我的 Google Apps 脚本签名代码 - How do I add my Google Apps Script signature code within my Google Forms 在Web应用程序后端中使用带有宏的Excel电子表格 - Using Excel spreadsheets with macros in backend of web application Google电子表格中的“发布”按钮,向Heroku发出HTTP请求 - 'Publish' button in Google Spreadsheets to make HTTP Request to Heroku 为什么对我的Google Apps脚本的Web App的GET请求间歇性地超时? - Why do GET requests to my Google Apps Script's Web App intermittently timeout? 从客户端发送到Google Apps脚本(服务器)base64字符串 - send from client side to google apps script (server) base64 string Google 文档“添加评论”快捷方式 (⌘+⌥+M) 不起作用 [关闭] - Google Docs "add a comment" shortcut (⌘+⌥+M) not working [closed] 自定义Google表单中的Google文档表单Formkey(2013年) - Google Docs Form Formkey in 2013 Custom Google Form HTML 使用 Apps 脚本登陆“谢谢”页面向 Google 表格提交表单 - HTML Form Submission to Google Sheets using Apps Scripts Landing "Thank You" Page
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM