繁体   English   中英

Google脚本-Google表单-获取项目字符串

[英]Google Scripts - Google Forms - Get Strings of Items

我在获取Google表单中的项目名称时遇到了一些困难。 我希望能够存储表单项名称,然后将其与if / else语句一起使用,以更好地过滤我的响应。 我能够获取表单中的项目数,但是无法提取这些表单项的名称。 谁能帮我弄清楚我缺少什么方法?

  //Capture Questions 
  var items = form.getItems();

  //Capture Question Titles, Provides # of items in "[items, items, ...]" format
  var itemsTitle = items.toString();

//Does nothing
var titles = itemsTitle.getTitle();

.getTitle()必须在项目对象而不是字符串上调用:

for ( var i in items ) {
  var title = items[i].getTitle()
}

items[0].getTitle()如果您知道该项目的确切索引)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM