AI-generated Key Takeaways
-
ParagraphTextValidationBuilder is used to create validation rules for ParagraphTextValidation in Google Forms.
-
It offers methods to require or disallow specific text patterns within a response.
-
It can also enforce minimum or maximum text length requirements for responses.
-
The builder methods return the builder object, allowing for chaining multiple validation rules.
A DataValidationBuilder for a Paragraph
.
// Add a paragraph text item to a form and require the answer to be at least 100 // characters. const form = FormApp . create ( 'My Form' ); const paragraphTextItem = form . addParagraphTextItem (). setTitle ( 'Describe yourself:' ); const paragraphtextValidation = FormApp . createParagraphTextValidation () . setHelpText ( 'Answer must be more than 100 characters.' ) . requireTextLengthGreaterThan ( 100 ); paragraphTextItem . setValidation ( paragraphtextValidation );
Methods
| Method | Return type | Brief description |
|---|---|---|
Paragraph
|
Requires response to contain pattern. | |
Paragraph
|
Requires response to not contain pattern. | |
Paragraph
|
Requires response to not match pattern. | |
Paragraph
|
Requires response length to be greater than or equal to value. | |
Paragraph
|
Requires response length to be less than value. | |
Paragraph
|
Requires response to match pattern. |
Detailed documentation
require
Text
Contains
Pattern(pattern)
Requires response to contain pattern.
Parameters
| Name | Type | Description |
|---|---|---|
pattern
|
String
|
text must contain pattern |
Return
Paragraph
— this for chaining
require
Text
Does
Not
Contain
Pattern(pattern)
Requires response to not contain pattern.
Parameters
| Name | Type | Description |
|---|---|---|
pattern
|
String
|
text must not contain pattern |
Return
Paragraph
— this for chaining
require
Text
Does
Not
Match
Pattern(pattern)
Requires response to not match pattern.
Parameters
| Name | Type | Description |
|---|---|---|
pattern
|
String
|
text must not match pattern |
Return
Paragraph
— this for chaining
require
Text
Length
Greater
Than
Or
Equal
To(number)
Requires response length to be greater than or equal to value.
Parameters
| Name | Type | Description |
|---|---|---|
number
|
Integer
|
paragraph text length must be greater than this value |
Return
Paragraph
— this for chaining
require
Text
Length
Less
Than
Or
Equal
To(number)
Requires response length to be less than value.
Parameters
| Name | Type | Description |
|---|---|---|
number
|
Integer
|
paragraph text length must be less than or equal to this value |
Return
Paragraph
— this for chaining
require
Text
Matches
Pattern(pattern)
Requires response to match pattern.
Parameters
| Name | Type | Description |
|---|---|---|
pattern
|
String
|
text must match pattern |
Return
Paragraph
— this for chaining

