Grid
的 DataValidationBuilder。
// Add a grid item to a form and require one response per column. const form = FormApp.create('My Form'); const gridItem = form.addGridItem(); gridItem.setTitle('Rate your interests') .setRows(['Cars', 'Computers', 'Celebrities']) .setColumns(['Boring', 'So-so', 'Interesting']); const gridValidation = FormApp.createGridValidation() .setHelpText('Select one item per column.') .requireLimitOneResponsePerColumn() .build(); gridItem.setValidation(gridValidation);
方法
方法 | 返回类型 | 简介 |
---|---|---|
require | Grid | 要求网格项每列限一条回答。 |