Sets the maximum number of lines of text that are displayed in the widget. If the text exceeds
the specified maximum number of lines, the excess content is concealed behind a "show more"
button. If the text is equal or shorter than the specified maximum number of lines, a "show
more" button isn't displayed.
Available for Google Chat apps. In developer preview for Google Workspace add-ons.
consttextParagraph=CardService.newTextParagraph().setText('This is a text paragraph widget. Multiple lines are allowed if needed.',).setMaxLines(1);
Parameters
Name
Type
Description
maxLines
Integer
The maximum number of lines of text that are displayed.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-30 UTC."],[[["The `TextParagraph` widget displays text with basic HTML formatting support."],["It is usable in Google Workspace Add-ons and Google Chat apps."],["Developers can set the displayed text using the `setText()` method and can chain additional methods for further customization."],["The `setText()` method requires a string argument representing the desired text content."]]],["The `TextParagraph` widget displays text with basic HTML formatting in Google Workspace add-ons and Google Chat apps. Key actions include `setText(text)` to define the displayed text and `setMaxLines(maxLines)` to limit the visible lines; exceeding this limit adds a \"show more\" button. `setMaxLines` is in developer preview for Google Workspace and available for Google Chat, whereas `setText` is fully available. Both methods return the `TextParagraph` object to enable method chaining.\n"]]