ทรัพยากรไฟล์ Manifest ของไดรฟ์
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
การกำหนดค่าทรัพยากรที่ใช้เพื่อกำหนดเนื้อหาและลักษณะการทำงานของส่วนเสริมของ Google Workspace
ภายใน Google ไดรฟ์
ไฟล์ Manifest ของส่วนเสริม Google Workspace ต้องมี
คอมโพเนนต์ทั้งหมดที่ทำเครื่องหมายเป็นต้องระบุหากขยายไดรฟ์
ไดรฟ์
การกำหนดค่าไฟล์ Manifest ของส่วนเสริม Google Workspace สำหรับ
ส่วนขยาย Google ไดรฟ์ ดูข้อมูลเพิ่มเติมได้ที่
การขยายไดรฟ์ด้วยส่วนเสริมของ Google Workspace
OnItemsSelectedTrigger
การกำหนดค่าสำหรับทริกเกอร์ตามบริบทที่จะเริ่มทำงานเมื่อผู้ใช้เลือกไฟล์หรือโฟลเดอร์อย่างน้อย 1 รายการใน Google ไดรฟ์ ดูข้อมูลเพิ่มเติมได้ที่
อินเทอร์เฟซตามบริบทของไดรฟ์สำหรับรายการที่เลือก
การแสดง JSON |
{
"runFunction": string
} |
ช่อง |
runFunction |
string
ชื่อของฟังก์ชันที่จะเรียกใช้เมื่อมีการเลือกไฟล์หรือโฟลเดอร์ใน
Google ไดรฟ์ หากระบุไว้ คุณต้องใช้ฟังก์ชันนี้เพื่อสร้าง
และส่งคืนอาร์เรย์ของ
ออบเจ็กต์ Card
เพื่อแสดงใน UI ของส่วนเสริม
|
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-31 UTC
[null,null,["อัปเดตล่าสุด 2025-08-31 UTC"],[[["\u003cp\u003eGoogle Workspace Add-on manifests extending Drive must include all required components.\u003c/p\u003e\n"],["\u003cp\u003eDrive extensions utilize a manifest configuration for defining add-on content and behavior within Google Drive.\u003c/p\u003e\n"],["\u003cp\u003eAn \u003ccode\u003eonItemsSelectedTrigger\u003c/code\u003e is required in the manifest to enable add-on functionality when users select Drive items.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eonItemsSelectedTrigger\u003c/code\u003e specifies a function that builds and returns Card objects for the add-on UI.\u003c/p\u003e\n"]]],[],null,["# Drive 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)\ncontent and behavior within Google Drive.\nGoogle Workspace add-on manifests must have\nall the components marked as **Required** if they extend Drive.\n\nDrive\n-----\n\nThe Google Workspace add-on manifest configuration for\nGoogle Drive extensions. See\n[Extending Drive with Google Workspace add-ons](/workspace/add-ons/drive)\nfor more information.\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------------------------|\n| ```text { \"homepageTrigger\": { object (HomepageTrigger) }, \"onItemsSelectedTrigger\": { object (OnItemsSelectedTrigger) } } ``` |\n\n| Fields ||\n|--------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `homepageTrigger` | `object (`[HomepageTrigger](/apps-script/manifest/homepage-trigger)`)` The trigger function specification for creating the add-on [homepage](/workspace/add-ons/concepts/homepages) in the Drive host. This overrides [`addOns.common.homepageTrigger`](/apps-script/manifest/addons#Common.FIELDS.homepageTrigger). |\n| `onItemsSelectedTrigger` | `object (`[OnItemsSelectedTrigger](#onitemsselectedtrigger)`)` **Required to provide add-on behavior triggered by user selection of items in Drive.** The contextual trigger function specification for item selections in Google Drive. |\n\n### OnItemsSelectedTrigger\n\nA configuration for a contextual trigger that fires when a user selects\none or more files or folders in Google Drive. See\n[Drive contextual interface for items selected](/workspace/add-ons/drive/building-drive-interfaces#drive_contextual_interface_for_items_selected)\nfor more information.\n\n| JSON representation |\n|---------------------------------------|\n| ```text { \"runFunction\": string } ``` |\n\n| Fields ||\n|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `runFunction` | `string` The name of the function to run when files or folders are selected in Google Drive. If specified, you must implement this function to build and return an array of [`Card`](/apps-script/reference/card-service/card) objects for display in the add-on UI. |"]]