[英]g-suite Google Calender Apps script On Event Save/Update
First of all, i am new to Google Workspace and this is the first time i am developing an addon.首先,我是 Google Workspace 的新手,这是我第一次开发插件。 I am trying to develop a Google Workspace(gsuite) Addon using Google Apps Script, My main objectives are:我正在尝试使用 Google Apps Script 开发一个 Google Workspace(gsuite) 插件,我的主要目标是:
Whenever i create/save/update
an event in Google Calender, i want to make an alert asking for ok
and cancel
, if i click cancel the event should not be created and if i click ok then the event should be created and the script function should call my API endpoint with the following parameters:每当我在 Google Calender 中create/save/update
事件时,我都想发出警报,要求ok
并cancel
,如果我单击取消,则不应创建该事件,如果单击确定,则应创建该事件和脚本功能应该使用以下参数调用我的 API 端点:
{ summary: summary_of_the_event, created: event_created_or_updated_date, googleCalendarId: calender_id }
Here is the reference to Apps script Google calender:以下是对 Apps 脚本 Google 日历的参考:
https://developers.google.com/apps-script/reference/calendar/calendar-app https://developers.google.com/apps-script/reference/calendar/calendar-app
I appreciate the help.我很感激你的帮助。
CalendarApp
features the installable calendar trigger with the specification : CalendarApp
具有可安装的日历触发器和规范:
Calendar triggers fire when a user's calendar events are updated (created, edited, or deleted).当用户的日历事件更新(创建、编辑或删除)时,日历触发器会触发。
Installble triggers can be used in Google Workspace add-ons Installble 触发器可用于Google Workspace 插件
Howver, this installable trigger only fire after the event has been created / updated, so it can help you to cancel event creation, but rather no manually delete the event a posteriori.但是,此可安装触发器仅在事件创建/更新后触发,因此它可以帮助您取消事件创建,而不是事后手动删除事件。
Mind also that the when the trigger fires, it does not give you any information about the created / updated event - you have to manually find this event eg by querying for the least created / updated event in user's calendar.还请注意,当触发器触发时,它不会为您提供有关创建/更新事件的任何信息 - 您必须手动查找此事件,例如通过查询用户日历中最少创建/更新的事件。
Google Workspace Calendar add-ons feature the manifest trigger for updating calendar events calendar.eventUpdateTrigger
Google Workspace 日历插件具有更新日历事件的清单触发器calendar.eventUpdateTrigger
This trigger only fires if the user makes one or more of the following edits:此触发器仅在用户进行以下一项或多项编辑时触发:
Adds one or more attendees.添加一名或多名与会者。
Removes one or more attendees.删除一名或多名与会者。
Adds or switches to a different conferencing solution.添加或切换到不同的会议解决方案。
Google Workspace Calendar add-ons also feature the manifest trigger calendar.eventOpenTrigger Google Workspace Calendar 插件还具有清单触发器calendar.eventOpenTrigger
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.