InsertWidget 物件的建構工具。開發人員可以將 Insert 傳遞至 Modify,將小工具插入資訊卡:
僅適用於擴充 Google Workspace Studio 的 Google Workspace 外掛程式。
用法範例:
const newWidget = CardService.newDecoratedText().setText('New Widget'); const insertWidget = AddOnsResponseService.newInsertWidget() .insertAboveWidget('sample_id') .setWidget(newWidget); const modifyCard = AddOnsResponseService.newModifyCard().setInsertWidget(insertWidget);
方法
| 方法 | 傳回類型 | 簡短說明 |
|---|---|---|
insert | Insert | 設定小工具 ID,新小工具會插入指定 ID 的小工具上方。 |
insert | Insert | 設定小工具 ID,新小工具會插入指定 ID 的小工具下方。 |
set | Insert | 設定要插入的 Widget。 |
內容詳盡的說明文件
insert Above Widget(widgetId)
設定小工具 ID,並在具有指定 ID 的小工具上方插入新小工具。如果找不到小工具 ID,系統會擲回錯誤。
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
widget | String | 要插入的小工具 ID。 |
回攻員
Insert:插入小工具物件,用於鏈結。
insert Below Widget(widgetId)
設定小工具 ID,新小工具會插入指定 ID 的小工具下方。如果找不到小工具 ID,系統會擲回錯誤。
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
widget | String | 下方要插入的小工具 ID。 |
回攻員
Insert:插入小工具物件,用於鏈結。