1. Does the API have access to Google Calendar of tasks?
2. Is it possible to ensure the trigger is triggered by a change in Google Tasks or a Calendar tied to Google Tasks?
3. When creating a trigger, how do I select the calendar for which the trigger should work?
Hello dear google-specialists, my apologies for the Google translator from Russian), my questions are:
Calendar Change Trigger
This was good info. I was looking for that as well.
I am also having trouble when I delete a calendar event via the API, it does not send cancellation notices to the guests. Any way to force it to send cancellation notices?
From: Jake Green
Sent: 2019-12-10 6:07 AM
To: Google Apps Script Community
Subject: [Apps-Script] Re: Calendar Change TriggerDimu Designs, I am very grateful for your reply. Very fast and helpful. This is exactly what I needed to find out! Thank you so much!--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
Yes I see that available in the REST API, but it does not seem to be available in the programmatical API interface which is the one I use. Hate to have to develop a REST interface just for this capability.
Thanks for looking at this.
From: google-apps-sc...@googlegroups.com <google-apps-sc...@googlegroups.com> On Behalf Of Clark Lind
Sent: December 17, 2019 4:37 AM
To: Google Apps Script Community <google-apps-sc...@googlegroups.com>
Subject: Re: [Apps-Script] Re: Calendar Change Trigger
The Calendar Advanced Services appears to include the "SendUpdates" option when deleting an event. Hope that is helpful!
On Friday, December 13, 2019 at 4:43:59 PM UTC-5, George wrote:
This was good info. I was looking for that as well.
I am also having trouble when I delete a calendar event via the API, it does not send cancellation notices to the guests. Any way to force it to send cancellation notices?From: Jake Green
Sent: 2019-12-10 6:07 AM
To: Google Apps Script Community
Subject: [Apps-Script] Re: Calendar Change TriggerDimu Designs, I am very grateful for your reply. Very fast and helpful. This is exactly what I needed to find out! Thank you so much!
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/33eb2dee-91d8-4fda-81a3-db6036e2cd7d%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/1561b8fd-dfe6-474c-a297-cc2c17e6e493%40googlegroups.com.
//Function to delete events from my calendar created by "XYZ Person"
//Filename: Code.gs
function doGet() {
var count = deleteActions();
var user = Session.getActiveUser().getEmail();
var template = HtmlService.createTemplateFromFile('index');
template.user = user;
template.count = count;
return template.evaluate();
}
function deleteActions() {
var calendarId = 'primary';
var optionalArgs = {
timeMin: (new Date()).toISOString(),
showDeleted: false,
singleEvents: true,
// sendUpdates: 'all', //I think this is where you would add
maxResults: 50,
orderBy: 'startTime'
};
var response = Calendar.Events.list(calendarId, optionalArgs);
var eventID = "";
var eventOwner = ""
var events = response.items;
var count = 0;
for (var i =0; i < events.length; i++) {
var event = events[i];
eventID = event.id;
eventOwner = event.organizer.email;
if (eventOwner == "[deleted for privacy]@group.calendar.google.com") {
modifyevent(eventID);
count = count +1;
}
}
return count;
}
function modifyevent(eventid){
var event = CalendarApp.getEventById(eventid);
event.deleteEvent();
}
//Small HTML file just to give me some feedback
//Filename: index.html
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<h3>Hello <?= user ?>,</h3><P>
<h5>I've deleted <?= count ?> Actions from your calendar.</h5>
<p>You may have to run this a few times. (Simply refresh this page to run again).<P>
</body>
</html>
Yes I see that available in the REST API, but it does not seem to be available in the programmatical API interface which is the one I use. Hate to have to develop a REST interface just for this capability.
Thanks for looking at this.
From: google-apps-sc...@googlegroups.com <google-apps-sc...@googlegroups.com> On Behalf Of Clark Lind
Sent: December 17, 2019 4:37 AM
To: Google Apps Script Community <google-apps-sc...@googlegroups.com>
Subject: Re: [Apps-Script] Re: Calendar Change Trigger
The Calendar Advanced Services appears to include the "SendUpdates" option when deleting an event. Hope that is helpful!
On Friday, December 13, 2019 at 4:43:59 PM UTC-5, George wrote:
This was good info. I was looking for that as well.
I am also having trouble when I delete a calendar event via the API, it does not send cancellation notices to the guests. Any way to force it to send cancellation notices?From: Jake Green
Sent: 2019-12-10 6:07 AM
To: Google Apps Script Community
Subject: [Apps-Script] Re: Calendar Change TriggerDimu Designs, I am very grateful for your reply. Very fast and helpful. This is exactly what I needed to find out! Thank you so much!
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/33eb2dee-91d8-4fda-81a3-db6036e2cd7d%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
Thanks for the suggestion. But I do not think this works. You are suggesting adding it as an optional argument when you obtain the list of events from the calendar. That would not help as far as I can tell getting notices sent to the guests that the event is deleted.
I did add that when I create the event hoping that when I delete it the guests would be notified, but it does not work.
Here is what I do when I create the event:
var cal = CalendarApp.getCalendarById(calendarId);
var event = cal.createEvent(subject, start, end, {
guests : notifyEmail,
description : message,
location : location,
guestsCanModify :'True',
sendInvites: 'True',
guestsCanInviteOthers: 'True',
sendUpdates: 'all',
sendNotifications: true,
reminders: {"hours" : 24}
});
As per your example, in the deleteEvent method:
var event = CalendarApp.getEventById(eventid);
event.deleteEvent();
Unfortunately, there is no arguments accepted to specify how it is deleted. I even tried to remove guests from the event before I delete it (hoping guests would be notified) but still no notifications are sent.
This one has had me baffled for a while and I suspect it is just a limitation of the API as currently defined.
Thanks,
George
From: google-apps-sc...@googlegroups.com <google-apps-sc...@googlegroups.com> On Behalf Of Clark Lind
Sent: December 18, 2019 5:06 AM
To: Google Apps Script Community <google-apps-sc...@googlegroups.com>
Subject: Re: [Apps-Script] Re: Calendar Change Trigger
You should be able to call advanced services from the normal Apps script interface. The syntax is just slightly different, and you just need to turn on the Calendar API (Resources --> Advanced Google Services --> Calendar API). I use some advanced services for deleting unwanted (duplicate) events on my calendar (I can see them on a different calendar, so don't need them on mine). I published this as a web app, and have it bookmarked on my browser Bookmark bar lol (I'm not much of a coder, so I know this can be cleaned up...)
//Function to delete events from my calendar created by "XYZ Person"
//Filename: Code.gs
function doGet() {
var count = deleteActions();
var user = Session.getActiveUser().getEmail();
var template = HtmlService.createTemplateFromFile('index');
template.user = user;
template.count = count;
return template.evaluate();
}
function deleteActions() {
var calendarId = 'primary';
var optionalArgs = {
timeMin: (new Date()).toISOString(),
showDeleted: false,
singleEvents: true,
// sendUpdates: all, //I think this is where you would add
maxResults: 50,
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/33eb2dee-91d8-4fda-81a3-db6036e2cd7d%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/1561b8fd-dfe6-474c-a297-cc2c17e6e493%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/27dbdca2-4e7b-424e-9465-43dc2e376a49%40googlegroups.com.
I have opened up a ticket to get this fixed. If you are impacted by this, please do a +1 on it.
https://issuetracker.google.com/issues/167800880
Thanks