Class TextParagraph

Text Paragraph

A widget that displays text and supports basic HTML formatting .

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

 const 
  
 textParagraph 
  
 = 
  
 CardService 
 . 
 newTextParagraph 
 (). 
 setText 
 ( 
  
 'This is a text paragraph widget. Multiple lines are allowed if needed.' 
 , 
 ); 

Methods

Method Return type Brief description
Text Paragraph Sets the maximum number of lines of text that are displayed in the widget.
Text Paragraph Sets the text of the paragraph.

Detailed documentation

set Max Lines(maxLines)

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.

 const 
  
 textParagraph 
  
 = 
  
 CardService 
 . 
 newTextParagraph 
 () 
  
 . 
 setText 
 ( 
  
 'This is a text paragraph widget. Multiple lines are allowed if needed.' 
 , 
  
 ) 
  
 . 
 setMaxLines 
 ( 
 1 
 ); 

Parameters

Name Type Description
max Lines
Integer The maximum number of lines of text that are displayed.

Return

Text Paragraph — This object, for chaining.


set Text(text)

Sets the text of the paragraph. Required.

Parameters

Name Type Description
text
String The text to display.

Return

Text Paragraph — This object, for chaining.

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