Class GridValidationBuilder

  • GridValidationBuilder is a DataValidationBuilder for a GridValidation in Google Apps Script forms.

  • It can be used to set validation rules for grid items, such as requiring a limit of one response per column.

  • The requireLimitOneResponsePerColumn() method is available to enforce this rule.

GridValidationBuilder

A DataValidationBuilder for a GridValidation .

// 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);

Methods

MethodReturn typeBrief description
requireLimitOneResponsePerColumn() GridValidationBuilder Requires limit of one response per column for a grid item.

Detailed documentation

requireLimitOneResponsePerColumn()

Requires limit of one response per column for a grid item.

Return

GridValidationBuilder — this validation builder, for chaining

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.