[null,null,["最后更新时间 (UTC):2025-08-29。"],[[["\u003cp\u003eGoogle Workspace add-ons can customize interfaces for viewing and editing Google Calendar events, enabling task automation and third-party system connections.\u003c/p\u003e\n"],["\u003cp\u003eAdd-ons can offer a homepage and a dedicated interface for interacting with calendar events, triggered by user actions.\u003c/p\u003e\n"],["\u003cp\u003eAdd-on interfaces are built using Card objects and event objects, which provide contextual information about the user's interaction.\u003c/p\u003e\n"],["\u003cp\u003eWhen a calendar event is opened or updated, specific triggers execute functions defined in the add-on manifest to dynamically update the interface or synchronize data.\u003c/p\u003e\n"],["\u003cp\u003eAdd-ons can integrate third-party conferencing solutions into Google Calendar, offering users additional options for online meetings.\u003c/p\u003e\n"]]],["Google Workspace add-ons customize Calendar interfaces by providing homepages and event-specific interfaces. Add-ons utilize trigger functions like `calendar.homepageTrigger` for the homepage and `eventOpenTrigger` for event interfaces. An `eventAttachmentTrigger` can also be defined to act as an attachment provider. Add-ons can be built with a Calendar-specific homepage or a common one and may use the event object parameter to tailor the UI. The `eventUpdateTrigger` can update events when attendees are changed or a different conferencing solution is selected. Add-ons may have a conferencing solution.\n"],null,["# Building Google Calendar interfaces\n\nGoogle Workspace add-ons can provide customized\ninterfaces when the user is viewing or editing calendars and Calendar events.\nThis lets you provide the user with additional relevant information, automate\ntasks, and connect third-party systems to Google Calendar.\n\nWhen building an add-on interface for Google Calendar, you can provide a\n[homepage](/workspace/add-ons/concepts/homepages). You can use the same\nhomepage for multiple hosts, or design a specific one for Google Calendar.\n\nYour add-on can also define an interface that appears when the user has\na Calendar event open.\n\nAccessing the add-on UI\n-----------------------\n\nDepending on how it's opened, a Google Workspace add-on can define a homepage interface, a Google Calendar event interface, an attachment selection interface, or all three:\n\n- If a user clicks the add-on icon while in a calendar view, the add-on executes the corresponding [`calendar.homepageTrigger`](/apps-script/manifest/calendar-addons#Calendar.FIELDS.homepageTrigger) function (if present). This function builds and returns a homepage card to Calendar for display. If no [`calendar.homepageTrigger`](/apps-script/manifest/calendar-addons#Calendar.FIELDS.homepageTrigger) function is defined, a generic homepage card is displayed instead.\n- If the user opens a Calendar event and then clicks the add-on icon, or the add-on is open when the user opens an event, the add-on executes the corresponding [`eventOpenTrigger`](/apps-script/manifest/calendar-addons#Calendar.FIELDS.eventOpenTrigger) function (if present). This function builds the add-on's Calendar event interface and returns to Google Calendar for display.\n- If the add-on defines an [`eventAttachmentTrigger`](/apps-script/manifest/calendar-addons#Calendar.FIELDS.eventAttachmentTrigger) function, the add-on appears as an attachment provider when the user clicks **Add attachment** while editing a Calendar event. When the add-on is selected, the [`eventAttachmentTrigger`](/apps-script/manifest/calendar-addons#Calendar.FIELDS.eventAttachmentTrigger) function builds the add-on's attachment selection interface and returns it to Google Calendar for display.\n\nBuilding the add-on Calendar interface\n--------------------------------------\n\nYou can extend Google Calendar with a\nGoogle Workspace add-on by following these steps:\n\n1. Decide whether you want your add-on to have a Calendar-specific [homepage](/workspace/add-ons/concepts/homepages). Also decide if you want to provide a custom interface while the user is editing Calendar events.\n2. Add the appropriate [`addOns.common`](/apps-script/manifest/addons#AddOns.FIELDS.common) and [`addOns.calendar`](/apps-script/manifest/addons#AddOns.FIELDS.calendar) fields to the add-on script project [manifest](/workspace/add-ons/concepts/workspace-manifests), including any [scopes](/workspace/add-ons/concepts/workspace-scopes#calendar_scopes) required.\n3. If you are providing a Calendar-specific [homepage](/workspace/add-ons/concepts/homepages), implement the [`calendar.homepageTrigger`](/apps-script/manifest/calendar-addons#Calendar.FIELDS.homepageTrigger) function to build this interface. You can also choose to use the [`common.homepageTrigger`](/apps-script/manifest/addons#Common.FIELDS.homepageTrigger) interface for multiple Google Workspace hosts.\n4. If you are providing a Calendar event interface, you must implement a [`calendar.eventOpenTrigger`](/apps-script/manifest/calendar-addons#Calendar.FIELDS.eventOpenTrigger) function to build this interface. See [Extending the Calendar event interface](#extending_the_calendar_event_interface) for details.\n5. Implement the associated callback functions needed to respond to the user's UI interactions, such as button clicks.\n\n### Calendar homepages\n\nGoogle Calendar supports displaying Google Workspace add-on [homepages](/workspace/add-ons/concepts/homepages).\nTo show your add-on's common homepage in Google Calendar, simply make sure there\nis an [`addOns.calendar`](/apps-script/manifest/addons#AddOns.FIELDS.calendar)\nfield in the add-on's manifest.\n\nAlternatively, add a\n[`calendar.homepageTrigger`](/apps-script/manifest/calendar-addons#Calendar.FIELDS.homepageTrigger)\nto the add-on manifest to provide a Calendar-specific homepage.\n\nIn either case, you must provide the name of a homepage trigger function in your\nadd-on's script project. This function is automatically called to build the\nGoogle Calendar homepage when it is needed. You must implement this function to build\nand return a single\n[`Card`](/apps-script/reference/card-service/card) or an array of\n[`Card`](/apps-script/reference/card-service/card)\nobjects that make up the homepage. The homepage trigger function is passed an\n[event object](/workspace/add-ons/concepts/event-objects)\nas a parameter that contains some general information such as the client's\nplatform. You can use the event object data to tailor the construction of the\nhomepage.\n\n### Extending the Calendar event interface\n\nGoogle Calendar relies on a contextual trigger to determine what interface\n(if any) to display when the user edits a Calendar event. When the trigger\nfires, it executes the contextual trigger function specified by the\n[`calendar.eventOpenTrigger`](/apps-script/manifest/calendar-addons#Calendar.FIELDS.eventOpenTrigger)\nfield in the add-on [manifest](/workspace/add-ons/concepts/workspace-manifests).\n\nYou must implement the function named in the\n[`calendar.eventOpenTrigger`](/apps-script/manifest/calendar-addons#Calendar.FIELDS.eventOpenTrigger)\nfield. This function accepts an [event object](#calendar_event_objects) as an\nargument and must return either a single\n[`Card`](/apps-script/reference/card-service/card) object or an array of\n[`Card`](/apps-script/reference/card-service/card) objects for Calendar to\ndisplay while the user has the event open.\n\n### Event objects\n\nAn [event object](/workspace/add-ons/concepts/event-objects) is created and\npassed to the\n[`calendar.eventOpenTrigger`](/apps-script/manifest/calendar-addons#Calendar.FIELDS.eventOpenTrigger)\ncontextual trigger function when a user opens\na Calendar event. The trigger function can use the information in this event\nobject to determine how to construct add-on cards or control the add-on\nbehavior. Event objects are also created and passed to\n[`homepageTrigger`](/apps-script/manifest/calendar-addons#Calendar.FIELDS.homepageTrigger)\nfunctions when an add-on is first opened, and when the user clicks or selects\ninteractive widgets.\n| **Note:** The term \"event\" in \"event object\" refers to an action taken by the user in the add-on UI and its associated response, not a Calendar event. To keep the distinction clear, events in Calendar are always referred to as \"Calendar events\" in this documentation.\n\nThe full structure of event objects is described in\n[Event objects](/workspace/add-ons/concepts/event-objects).\nWhen Calendar is the acting host app of the add-on, contextual trigger and\nwidget interaction event objects include the\n[Calendar event object](/workspace/add-ons/concepts/event-objects#calendar_event_object)\nfield that carries Calendar-specific client information.\n\n### Updating Calendar events\n\nIn addition to the contextual\n[`calendar.eventOpenTrigger`](/apps-script/manifest/calendar-addons#Calendar.FIELDS.eventOpenTrigger)\nthat fires when a user opens\na Calendar event for editing, you can also define an\n[`calendar.eventUpdateTrigger`](/apps-script/manifest/calendar-addons#Calendar.FIELDS.eventUpdateTrigger)\nthat fires when the user updates and saves a Calendar event. This trigger only\nfires if the user makes one or more of the following edits:\n\n- Adds one or more attendees.\n- Removes one or more attendees.\n- Adds or switches to a different conferencing solution.\n\nWhen this trigger fires, it executes the\ntrigger function specified by the\n[`calendar.eventUpdateTrigger`](/apps-script/manifest/calendar-addons#Calendar.FIELDS.eventUpdateTrigger)\nmanifest field. The function is executed before the Calendar event edit is\nsaved.\n\nThe [`calendar.eventUpdateTrigger`](/apps-script/manifest/calendar-addons#Calendar.FIELDS.eventUpdateTrigger)\nis typically used to do one or more of the following:\n\n- Update the add-on's Calendar event interface in response to user changes to the Calendar event.\n- Sync Calendar event data with a third-party system, such as a conferencing system that is connected to Google Calendar.\n\nIf you need your add-on to make adjustments to a Calendar event's data (such\nas its attendee list), you must set the add-on\n[`calendar.currentEventAccess`](/apps-script/manifest/calendar-addons#Calendar.FIELDS.currentEventAccess)\nmanifest field to `WRITE` or `READ_WRITE`. This also\nrequires the add-on to have the\n`https://www.googleapis.com/auth/calendar.addons.current.event.write`\n[scope](/workspace/add-ons/concepts/workspace-scopes#calendar_scopes).\n\nAdding conferencing solutions\n-----------------------------\n\n| **Note:** Adding conference solutions is only of use to developers that want to integrate a third-party conference system they maintain into Google Calendar. This functionality was previously released in beta as *Calendar conferencing add-ons*, but now is available in Google Workspace add-ons.\n\n[Conferencing solutions](/workspace/add-ons/calendar/conferencing/overview#conference_solutions)\nrepresent a third-party conference options that users can attach to\nGoogle Calendar events. The\n[Third-party conferencing overview](/workspace/add-ons/calendar/conferencing/overview)\ndocumentation provides details on how to build an add-on that adds new\nconferencing solutions. It isn't necessary to build a UI for this type of\nextension; added solutions simply appear as options in the drop-down menu of\nthe Google Calendar event UI."]]