The 'CalendarApp' is used to perform the task and we start by getting hold of the relevant event, which for the purposes of demonstrating is hard-coded into the Apps Script but is likely to be taken from a spreadsheet in reality.
var event = CalendarApp.getEventById(eventId);Next we want to get a list of the Guests which will be returned as an array.
var guestList = event.getGuestList();Finally we need to loop through each Guest and extract their email address and status.
for (var i=0; i<guestList.length; i++) {Search event for Guest list.gs
var guest = guestList[i];
var guestEmail = guest.getEmail();
var guestStatus = guest.getGuestStatus();
}
Hi,
ReplyDeleteis there anyway to include the organizer in the list ?
Hi
DeleteYes, this blog post better fits what you want: https://www.pbainbridge.co.uk/2019/07/search-google-calendar-for-event-details.html.
It sounds like you want the 'creator' of the event - so you would use 'getCreators()' - https://developers.google.com/apps-script/reference/calendar/calendar-event#getcreators
Kind regards
Phil