2014-07-08 21 views
0

有我的问题的玩具例子:谷歌企业应用套件脚本:触发传递未定义

使用示例表格:https://docs.google.com/forms/d/1od5Bp5z0hAeeW5uJoweiRpUPwdItH7Xj2tpsgqPCI7s/viewform

如果我填好这张表格,这个脚本被触发:

function onFormSubmit(e) { 

// Get information from form and set it as variables 

var email_address = "[email protected]"; 

// 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); 


} 

,我得到了以下电子邮件:

enter image description here

我的问题是'未定义'位 - 这是传入的事件,我应该在给定的一组测试中看到某种形式的['aaa','bbb','ccc'] - 每当我尝试时并访问脚本不会运行的值之一,这表明onFormSubmit正在触发一个空白事件。

任何想法是什么造成这种情况?

Ĵ

编辑 - 今天其实我从当我试图用VAR希望= e.values [0]错误的电子邮件 - 希望这有助于。 enter image description here

回答

相关问题