Class GridValidation

  • GridValidation is a DataValidation specifically for GridItem in Google Forms.

  • It allows setting validation rules like requiring one response per column for a GridItem.

  • GridValidation can include custom help text to guide user input.

GridValidation

A DataValidation for a GridItem .

// Add a grid item to a form and require one response per column.
constform=FormApp.create('My Form');
constgridItem=form.addGridItem();
gridItem.setTitle('Rate your interests')
.setRows(['Cars','Computers','Celebrities'])
.setColumns(['Boring','So-so','Interesting']);
constgridValidation=FormApp.createGridValidation()
.setHelpText('Select one item per column.')
.requireLimitOneResponsePerColumn()
.build();
gridItem.setValidation(gridValidation);

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年12月02日 UTC.