Home > Enterprise >  Set Google Calendar Event Description with AddOn
Set Google Calendar Event Description with AddOn

Time:04-25

Goal

Im working on building a Google Calendar modify the description of a Google Calendar Event.

Problem

I do not see how to edit the event description. I followed this tutorial to start building the AddOn.

I also found this documentation that shows how to edit the attendees, but I have not been able to figure out how to edit the description of an event from within an AddOn.

CodePudding user response:

What's wrong with using setDescription and setTitle

function saveDescriptionAndTitle(obj) {
  let cal = CalendarApp.getCalendarById(obj.calid);
  let ev = cal.getEventById(obj.evid);
  ev.setTitle(obj.title);
  ev.setDescription(obj.desc);
}

CodePudding user response:

For this, you will need to be required to call google APIs there is no method to directly update the event description without an API

API Ref. - https://developers.google.com/calendar/api/v3/reference/events/update

In AppScript there 1 class that you can use to call that API might be that helps you

https://developers.google.com/apps-script/reference/calendar/calendar-app?hl=en#setdescriptiondescription

  • Related