Class ModifyCard

ModifyCard

A builder for ModifyCard objects that changes and updates an existing card's interface by passing the ModifyCard object to a Action . For usage, see Update configuration cards.

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);
constnavigation=AddOnsResponseService.newNavigation().addModifyCard(modifyCard);

Methods

MethodReturn typeBrief description
setInsertSection(insertSection) ModifyCard Sets the InsertSection for this modify card object.
setInsertWidget(insertWidget) ModifyCard Sets the InsertWidget for this modify card object.
setRemoveSection(removeSection) ModifyCard Sets the RemoveSection for this modify card object.
setRemoveWidget(removeWidget) ModifyCard Sets the RemoveWidget for this modify card object.
setReplaceSection(replacementSection) ModifyCard Sets the replacement CardSection for this modify card object, the replacement section should have the same id as an existing card section.
setReplaceWidget(replacementWidget) ModifyCard Sets the replacement widget for this modify card object, the replacement widget should have the same id as an existing widget.
setUpdateWidget(updateWidget) ModifyCard Sets the UpdateWidget for this modify card object.

Detailed documentation

setInsertSection(insertSection)

Sets the InsertSection for this modify card object.

Parameters

NameTypeDescription
insertSectionInsertSection The insert section to apply to the card.

Return

ModifyCard — This modify card object, for chaining.


setInsertWidget(insertWidget)

Sets the InsertWidget for this modify card object.

Parameters

NameTypeDescription
insertWidgetInsertWidget The InsertWidget to apply to the card.

Return

ModifyCard — This modify card object, for chaining.


setRemoveSection(removeSection)

Sets the RemoveSection for this modify card object.

Parameters

NameTypeDescription
removeSectionRemoveSection The RemoveSection to apply to the card.

Return

ModifyCard — This modify card object, for chaining.


setRemoveWidget(removeWidget)

Sets the RemoveWidget for this modify card object.

Parameters

NameTypeDescription
removeWidgetRemoveWidget The RemoveWidget to apply to the card.

Return

ModifyCard — This modify card object, for chaining.


setReplaceSection(replacementSection)

Sets the replacement CardSection for this modify card object, the replacement section should have the same id as an existing card section.

Parameters

NameTypeDescription
replacementSectionCardSection The replacement section to overwrite an existing card section.

Return

ModifyCard — This modify card object, for chaining.


setReplaceWidget(replacementWidget)

Sets the replacement widget for this modify card object, the replacement widget should have the same id as an existing widget.

Parameters

NameTypeDescription
replacementWidgetWidget The replacement widget to overwrite an existing widget.

Return

ModifyCard — This modify card object, for chaining.


setUpdateWidget(updateWidget)

Sets the UpdateWidget for this modify card object.

Parameters

NameTypeDescription
updateWidgetUpdateWidget The UpdateWidget to apply to the card.

Return

ModifyCard — This modify card 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.