'Set Google Calendar Event Description with AddOn

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.

Added info

Visual representation of the goal

enter image description here

Output from eventUpdateTrigger

The below object shows that the eventId is not given to the eventUpdateTrigger callback

    "hostApp": "calendar",
    "commonEventObject": {
        "platform": "WEB",
        "hostApp": "CALENDAR"
    },
    "calendar": {
        "organizer": {
            "email": "<email>"
        },
        "capabilities": {
            "canSetConferenceData": true,
            "canAddAttendees": true,
            "canSeeConferenceData": true,
            "canSeeAttendees": true
        },
        "calendarId": "[email protected]",
        "id": "<id>"
    },
    "clientPlatform": "web"
}


Solution 1:[1]

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);
}

Solution 2:[2]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Manish Pareek