在将事件从Google工作表添加到日历之前,请检查事件是否存在 [英] check if event exists before adding it from google sheet to calendar

查看:116
本文介绍了在将事件从Google工作表添加到日历之前,请检查事件是否存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个脚本,可以从工作表更新日历. 是否可以获取如果不存在的事件我将添加到日历中的事件的eventID?

I've got a script that updates a calendar from a sheet. Is there a way of getting the eventID of an event i would add to the calendar if it didn't exist ?

要创建的事件的ID(标题,开始,停止)

what would be the ID of the event to be created with (title, start, stop)

然后我可以对照现有事件的eventID进行检查,并添加,如果还不存在的话. 我认为这比在添加新属性或继续进行

I can then check it against the eventIDs of existing events and add , if not already there. i think this would be quicker than checking existing events for matching all properties before either adding the new one , or just moving on

推荐答案

可以完成,但是需要一些工作.

It can be done, but its going to take a bit of work.

默认情况下,事件ID是自动生成的. 不过,只要事件的自定义ID符合Google的格式,就可以为其生成自定义ID要求.因此,您必须自己管理这些事件ID的生成.

Event ids are auto-generated by default. However, you can generate custom ids for an event as long as they conform to Google's format requirements. So, you'll have to manage the generation of these event ids yourself.

您将必须确保ID是唯一的,因此您可能希望将其基于与事件相关的输入的组合.

You will have to ensure that the id is unique, so you might want to base it on a combination of inputs related to the event.

一旦有了生成唯一ID的某种方式,就可以使用它直接通过ID获取事件,但是必须使用

Once you have some way of generating a unique id, you can use it to fetch an event directly by id, but you have to use the Advanced Calendar Service (the built-in service does not allow lookup by event id, but it does allow lookup by iCalUID).

这篇关于在将事件从Google工作表添加到日历之前,请检查事件是否存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆