Class Validation

Validation

An object that defines the validation rule for the widget that it is attached to.

Available for Google Chat apps and Google Workspace add-ons.

 const 
  
 validation 
  
 = 
  
 CardService 
 . 
 newValidation 
 (). 
 setCharacterLimit 
 ( 
 '10' 
 ). 
 setInputType 
 ( 
  
 CardService 
 . 
 InputType 
 . 
 TEXT 
 ); 

Methods

Method Return type Brief description
Validation Sets the character limit of the widget.
Validation Sets the input type of the widget.

Detailed documentation

set Character Limit(characterLimit)

Sets the character limit of the widget.

Available for Google Chat apps and Google Workspace add-ons.

Parameters

Name Type Description
character Limit
Integer The character limit to set. Note that this restriction is only effective for Text Input and is ignored for other widgets.

Return

Validation — This object, for chaining.


set Input Type(inputType)

Sets the input type of the widget.

Available for Google Chat apps and Google Workspace add-ons.

Parameters

Name Type Description
input Type
Input Type The Input Type to set.

Return

Validation — This object, for chaining.

Create a Mobile Website
View Site in Mobile | Classic
Share by: