问题标签 [google-apps-script]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
532 浏览

tabpanel - 删除 Google Apps 脚本中的选项卡面板

我使用 Google Apps Script 的 UI 服务创建了一个包含几个选项卡的选项卡面板,并在每个选项卡中添加了一个按钮,让用户可以删除该特定选项卡。为此,我在按钮上附加了一个应该处理此任务的服务器处理程序。但是,我无法删除标签。我尝试了各种代码,包括

tabpanel.remove(tabnum);

tabpanel.remove(tab);

已知在 GWT 中工作,但在 Google Apps 脚本中显然没有。

0 投票
1 回答
5398 浏览

google-apps-script - Google Apps Script - How to add columns (inc formulas and formatting) to a spreadsheet generated from Google Form data?

OK so I think what I need doing is relatively complicated. At the moment we have a form which participants can fill out. We have a script implemented that means every time a form gets submitted it creates a new sheet within the spreadsheet the information is then passed through something similar to an IF function to change the Yes and No answers to 1 and 0. It looks like this:

Now I want to implement the next stage. What I want to happen if for another sheet with various formulas and formatting to be added to the sheet that my current script generates and for the data generated from the form to be inserted within a certain column on that sheet that contains the formulas. I want this to happen every time the original script generates a new sheet. The sheet that contains the various formulas and formatting is contained within the same spreadsheet.

I hope this makes sense.....thank you very much in advance

0 投票
2 回答
4669 浏览

html - 如何访问或调用“将此表格发送给其他人”?

我有一个附加到 Google Apps 电子表格的表单。这是让我的同事向我们的每周审查会议提交议程项目的表格。我正在编写一个脚本来自动向相关人员发送电子邮件提醒。

为了让他们不那么烦人和乏味,我想将表单嵌入到电子邮件中。Google Docs 提供了一种手动发送表单的方法:电子表格 > 表单 > 发送表单。但是,我在 Google Apps 脚本文档中找不到任何可以触发此功能的方法,例如

  • 类似 sendFormInEmail 的方法
  • 访问电子邮件友好的表单 HTML,我可以将其分配给sendEmail 方法的 htmlBody 参数。
  • 在 Google Apps 中触发任意菜单项
  • 还有什么?

我可以通过从电子邮件中提取生成的 HTML 并将其分配为 htmlBody 参数来解决问题,但是每次我们想要更改表单时,我都必须手动更新 html——而不是我想要的发生。

有什么建议么?

0 投票
1 回答
983 浏览

google-apps-script - 脚本开始抛出“Reference error SpreadsheetApp is undefined”

我为 Google 表格制作了一个脚本。自从人们使用它并完美运行以来已经一个月了。

基本上,脚本在电子表格中查找,用数据制作一些公式并返回一个值。

在脚本的开头,我调用了“SpreadsheetApp.getActiveSpreadsheet()”函数,它返回了实际的电子表格。问题是有时脚本会返回一个错误,上面写着“参考错误:SpreadsheetApp 未定义”。

奇怪的是,如果我关闭电子表格并在 5 分钟(随机时间)后再次打开它,脚本运行良好!我找不到错误模式。我不知道这是我做的东西,还是谷歌的东西。

谁能帮我?

0 投票
2 回答
16300 浏览

json - 如何从 Google Docs 电子表格中检索数据?

我发现了这个以 JSON 格式从 Google 电子表格中提取数据的精彩示例: http ://code.google.com/apis/gdata/samples/spreadsheet_sample.html

但是,我似乎无法让它适用于我创建的电子表格。我已将文档公开并发布,并尝试了对键和工作表“名称”的所有可能调整。有没有人成功使用过这个?我看过 Zend GData 库,但更愿意使用 JSON。

提前感谢您的任何提示。

0 投票
1 回答
443 浏览

google-apps-script - 使用 Fusion tables API 和 Google Apps 脚本时无法设置 Content-length 的值

我有以下 Google Apps 脚本代码可将值发布到 Fusion 表:

每次运行此代码时,我都会收到以下错误: 属性提供的值无效:标头:内容长度(第 36 行)

我已尝试删除“内容长度”标头,但出现有关sql 参数不能为空的错误

0 投票
1 回答
138 浏览

google-apps-script - RadioButtons 生成?

我正在研究会生成单选按钮列表的脚本。用户必须选择其中一个答案,然后一个单元格会填满结果。

单选按钮的数量一开始是未知的,取决于一组 gmail 联系人中的联系人数量。

我的问题很简单,如何根据需要显示尽可能多的单选按钮?我试图将它们放在一个循环中,但似乎除了我的提交按钮之外什么都没有加载。

任何提示将不胜感激!

提前致谢

0 投票
1 回答
565 浏览

google-apps-script - 在 Google Apps 脚本的 VerticalPanel 中访问小部件?

有没有办法访问 GAS 面板中的小部件?

就像是:

0 投票
1 回答
2117 浏览

javascript - Google Apps 脚本 UrlFetchApp 异常

m in the process of creating a custom timesheet using Google Docs and Google Apps Script. One of the requirements is to save the timsheet as a PDF when the user submits the timesheet. Here是我目前拥有的:

调试脚本时,我收到以下错误:

序列化延续时出现意外异常

任何帮助,将不胜感激。

0 投票
2 回答
136 浏览

google-apps-script - 我可以访问在一个“Google Apps”域中发送的所有电子邮件的标头吗?

我想为组织中使用的一个“Google Apps”域中发生的所有邮件通信创建一个实时可视化。

是否有任何 API 可用于获取实时回调,或者至少有一些 API 可以定期提取以获取组织内发送的所有电子邮件的标题?