Class ParagraphTextValidation
Stay organized with collections
Save and categorize content based on your preferences.
ParagraphTextValidation
A DataValidation for a ParagraphTextItem
.
// 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.')
.requireTextLengthGreaterThanOrEqualTo(100)
.build();
paragraphTextItem.setValidation(paragraphtextValidation);
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.
[null,null,["Last updated 2024-12-02 UTC."],[[["\u003cp\u003eParagraphTextValidation is a tool in Google Forms to set validation rules for paragraph text items.\u003c/p\u003e\n"],["\u003cp\u003eIt allows setting requirements like minimum character length with help text to guide users.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use \u003ccode\u003eParagraphTextValidation\u003c/code\u003e through Apps Script to enforce these rules within their forms.\u003c/p\u003e\n"]]],[],null,["# Class ParagraphTextValidation\n\nParagraphTextValidation\n\nA DataValidation for a [ParagraphTextItem](/apps-script/reference/forms/paragraph-text-item).\n\n```javascript\n// Add a paragraph text item to a form and require the answer to be at least 100\n// characters.\nconst form = FormApp.create('My Form');\nconst paragraphTextItem =\n form.addParagraphTextItem().setTitle('Describe yourself:');\nconst paragraphtextValidation =\n FormApp.createParagraphTextValidation()\n .setHelpText('Answer must be more than 100 characters.')\n .requireTextLengthGreaterThanOrEqualTo(100)\n .build();\nparagraphTextItem.setValidation(paragraphtextValidation);\n```"]]