Class CheckboxValidation

CheckboxValidation

A DataValidation for a CheckboxItem.

 // Add a checkBox item to a form and require exactly two selections.
 var checkBoxItem = form.addCheckboxItem();
 checkBoxItem.setTitle('What two condiments would you like on your hot dog?');
 checkBoxItem.setChoices([
   checkBoxItem.createChoice('Ketchup'),
   checkBoxItem.createChoice('Mustard'),
   checkBoxItem.createChoice('Relish')
 ]);
 var checkBoxValidation = FormApp.createCheckboxValidation()
   .setHelpText(“Select two condiments.”)
   .requireSelectExactly(2)
   .build();
 checkBoxItem.setValidation(checkBoxValidation);
 

Methods

MethodReturn typeBrief description
getHelpText()StringGets the DataValidation's help text.

Detailed documentation

getHelpText()

Gets the DataValidation's help text. This text is shown to the user if the input fails validation.

Return

String — the DataValidation's help text

Send feedback about...

Apps Script
Apps Script