Class InsertSection Stay organized with collections Save and categorize content based on your preferences.
A builder for InsertSection objects. Developers can insert a new section to the card by passing aInsert toModify
Only available for Google Workspace add-ons that extend Google Workspace Studio.
Sample usage:
constinsertSection=AddOnsResponseService.newInsertSection().insertBelowSection('sample_id').setSection(CardService.newCardSection().setHeader('New Section'));constmodifyCard=AddOnsResponseService.newModifyCard().setInsertSection(insertSection);
Methods
| Method | Return type | Brief description |
|---|---|---|
insert | Insert | Sets the onCardTop flag, which indicates whether the new section should be inserted at the topof the card. |
insert | Insert | Sets the section ID, and the new section is inserted below it. |
set | Insert | Sets the card section to be inserted. |
Detailed documentation
insertAtTop(onCardTop)
Sets the onCardTop flag, which indicates whether the new section should be inserted at the topof the card.
Parameters
| Name | Type | Description |
|---|---|---|
on | Boolean | The onCardTop flag. |
Return
Insert — The insert section object, for chaining.
insertBelowSection(sectionId)
Sets the section ID, and the new section is inserted below it. If the section ID is not found,then the new section is inserted at the end of the card.
Parameters
| Name | Type | Description |
|---|---|---|
section | String | The ID of the section to insert below. |
Return
Insert — The insert section object, for chaining.
setSection(section)
Sets the card section to be inserted.
Parameters
| Name | Type | Description |
|---|---|---|
section | Card | TheCard to be inserted. |
Return
Insert — The insert section object, for chaining.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-03 UTC.