HomeTrigger 資訊清單資源
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
用於定義 Google Workspace 外掛程式
首頁觸發條件的資源設定。
HomepageTrigger
Google Workspace 外掛程式資訊清單的首頁觸發條件設定。
您可以在addOns.common.homepageTrigger
資源或個別主機應用程式的資源中定義首頁觸發條件。如果已定義並啟用主機應用程式的首頁觸發條件,該條件會覆寫 addOns.common.homepageTrigger
中定義的首頁觸發條件。
詳情請參閱「首頁設定」。
JSON 表示法 |
{
"enabled": boolean,
"runFunction": string
} |
欄位 |
enabled |
boolean
是否為這個代管應用程式啟用首頁 (非情境式) 資訊卡。這個變數預設為 true 。
|
runFunction |
string
觸發條件觸發時要執行的函式名稱。如果指定,您必須實作這個函式,才能建構及傳回一或多個 Card 物件的陣列,以便在這個主機應用程式中顯示為這個外掛程式的首頁。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-31 (世界標準時間)。
[null,null,["上次更新時間:2025-08-31 (世界標準時間)。"],[[["\u003cp\u003eHomepage triggers define the configuration for Google Workspace Add-on homepages, letting you control card display and functionality.\u003c/p\u003e\n"],["\u003cp\u003eThese triggers can be set globally or for specific host applications, with host-specific settings taking precedence.\u003c/p\u003e\n"],["\u003cp\u003eHomepage triggers are configured using the \u003ccode\u003eenabled\u003c/code\u003e and \u003ccode\u003erunFunction\u003c/code\u003e fields within the add-on's manifest file.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003erunFunction\u003c/code\u003e field points to a function that constructs and returns \u003ccode\u003eCard\u003c/code\u003e objects to populate the add-on's homepage.\u003c/p\u003e\n"]]],[],null,["# HomepageTrigger manifest resource\n\nThe resource configuration that is used to define\n[Google Workspace add-on](/workspace/add-ons/concepts/types#g_suite_add-ons)\n[homepage triggers](/workspace/add-ons/concepts/homepages#homepage_configuration).\n\nHomepageTrigger\n---------------\n\nThe Google Workspace add-on manifest configuration for\n[homepage triggers](/workspace/add-ons/concepts/homepages#homepage_configuration).\n\nHomepage triggers can be defined in the\n[`addOns.common.homepageTrigger`](/apps-script/manifest/addons#Common.FIELDS.homepageTrigger)\nresource or the resources of the individual\n[host applications](/workspace/add-ons/guides/glossary#host_or_host_application).\nThe homepage trigger of a host application, if defined and enabled, overrides\nthe homepage trigger defined in\n[`addOns.common.homepageTrigger`](/apps-script/manifest/addons#Common.FIELDS.homepageTrigger).\n\nSee [Homepage configuration](/workspace/add-ons/concepts/homepages#homepage_configuration)\nfor more details.\n\n| JSON representation |\n|-----------------------------------------------------------|\n| ```text { \"enabled\": boolean, \"runFunction\": string } ``` |\n\n| Fields ||\n|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `enabled` | `boolean` Whether or not homepage (non-contextual) cards are enabled for this host application. Defaults to `true`. |\n| `runFunction` | `string` The name of the function to run this trigger fires. If specified, you must implement this function to build and return an array of one or more [`Card`](/apps-script/reference/card-service/card) objects for display as this add-on's homepage in this host application. |"]]