Class GridValidation
网格验证
GridItem
的 DataValidation。
// 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);
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-12-02。
[null,null,["最后更新时间 (UTC):2024-12-02。"],[[["`GridValidation` is used to apply validation rules specifically to grid items within Google Forms."],["It allows you to enforce restrictions like requiring one response per column within the grid, enhancing data quality."],["Developers can set custom help text to guide users on how to interact with the grid and meet validation criteria."]]],[]]