Class InsertSection

InsertSection

A builder for InsertSection objects. Developers can insert a new section to the card by passing a InsertSection to ModifyCard

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

MethodReturn typeBrief description
insertAtTop(onCardTop) InsertSection Sets the onCardTop flag, which indicates whether the new section should be inserted at the top of the card.
insertBelowSection(sectionId) InsertSection Sets the section ID, and the new section is inserted below it.
setSection(section) InsertSection 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 top of the card.

Parameters

NameTypeDescription
onCardTopBooleanThe onCardTop flag.

Return

InsertSection — 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

NameTypeDescription
sectionIdStringThe ID of the section to insert below.

Return

InsertSection — The insert section object, for chaining.


setSection(section)

Sets the card section to be inserted.

Parameters

NameTypeDescription
sectionCardSection The CardSection to be inserted.

Return

InsertSection — The insert section object, for chaining.

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 2025年12月03日 UTC.