[英]Function passes undefined to called function in Google Apps Script
[英]Google Apps script: trigger passes undefined
有一个玩具示例可以解决我的问题:
使用以下示例表格: https : //docs.google.com/forms/d/1od5Bp5z0hAeeW5uJoweiRpUPwdItH7Xj2tpsgqPCI7s/viewform
如果我填写该表格,则会触发以下脚本:
function onFormSubmit(e) {
// Get information from form and set it as variables
var email_address = "joe.reddington@gmail.com";
// Get document template, copy it as new temp doc and save the Doc's info +[WE MAY
var hope = e.values;
// Email this document to the emails at the top of this page
var subject = "This is a New request received!" +hope;
var body = "Hello world";
MailApp.sendEmail(email_address, subject, body);
}
我收到以下电子邮件:
我的问题是“未定义”位-这是正在传递的事件,每当我尝试访问时,对于给定的一组测试,我应该会看到某种形式的['aaa','bbb','ccc']脚本将不会运行的值之一,这向我提示onFormSubmit正在触发空白事件。
任何想法是什么原因造成的?
Ĵ
编辑-实际上,今天,当我尝试使用var hope = e.values [0]时,我收到了错误电子邮件-希望这会有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.