Class CheckboxGridValidation
CheckboxGridValidation
A DataValidation for a CheckboxGridItem
.
// Add a checkbox grid item to a form and require one response per column.
var checkboxGridItem = form.addCheckboxGridItem();
checkboxGridItem.setTitle('Where did you celebrate New Years?')
.setRows(['New York', 'San Francisco', 'London'])
.setColumns(['2014', '2015', '2016', '2017']);
var checkboxGridValidation = FormApp.createCheckboxGridValidation()
.setHelpText(“Select one item per column.”)
.requireLimitOneResponsePerColumn()
.build();
checkboxGridItem.setValidation(checkboxGridValidation);
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[null,null,["Last updated 2024-10-31 UTC."],[[["`CheckboxGridValidation` is used to set validation rules specifically for `CheckboxGridItem` within Google Forms."],["It allows you to enforce constraints like requiring exactly one response per column in a checkbox grid, enhancing data integrity and user experience."],["You can customize the validation with help text to guide users on expected input."]]],[]]