【发布时间】:2021-07-17 16:21:24
【问题描述】:
Google App Script SelectionInput docs 显示带有静态选项列表的选择输入。尝试创建如下动态选项列表:
var items = [...];
var selectWidget = CardService.newSelectionInput()
.setType(CardService.SelectionInputType.DROPDOWN)
.setTitle("Select an item")
.setFieldName("item");
items.forEach(function (item) {
selectWidget.addItem(item, item, false);
});
导致运行时错误:
Object does not have property
- /Card/sections[0]/widgets[1]/selection_control/items. [line: 115, function: XYZ, file: Code]
我应该如何在我的 gmail 插件中创建带有动态选项的选择输入?
【问题讨论】:
标签: google-apps-script gmail-addons