// Add a checkbox grid item to a form and require one response per column.
const form = FormApp.openById('123abc');
const checkboxGridItem = form.addCheckboxGridItem();
checkboxGridItem.setTitle('Where did you celebrate New Years?')
.setRows(['New York', 'San Francisco', 'London'])
.setColumns(['2014', '2015', '2016', '2017']);
const checkboxGridValidation = FormApp.createCheckboxGridValidation()
.setHelpText('Select one item per column.')
.requireLimitOneResponsePerColumn()
.build();
checkboxGridItem.setValidation(checkboxGridValidation);
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2024-12-02 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."]]],[]]