Since he originally asked how to click into the calendar and find the ID of a particular event, and since that's what I needed to know how to do too:
Click the event in your Google Calendar.
It will take you to a page with a URL such as https://calendar.google.com/calendar/render?pli=1#eventpage_6%7Ceid-NGh0Z3BtbTFobWFrNzQ0cjBrYmtkY29kYXIgZXVndTlrYW4xZGRpMXBtaTZzazNpYjWoNmdAZw-1-0-
Look for "eid" in the URL.
Select and copy the string between and the next eid-. (In my example here, it is -.)NGh0Z3BtbTFobWFrNzQ0cjBrYmtkY29kYXIgZXVndTlrYW4xZGRpMXBtaTZzazNpYjWoNmdAZw
Now you need to decode from Base64 format. You could paste that string into a tool such as https://www.base64decode.org/.
The result will be two strings separated by a space. The first string is your Event ID.
Property name | Value | Description |
anyoneCanAddSelf | boolean | Whether anyone can invite themselves to ... |
attachments [] | list | File attachments for the event. In order ... |
attachments [].fileId | string | ID of the attached file. Read-only. For ... |
attachments [].fileUrl | string | URL link to the attachment. For adding ... |
I understand that you want for using event-id. Is my understanding correct? If my understanding is correct, how about this modification?https://www.google.com/calendar/event?eid={event-id}&ctz={timezone}
event-id of https://www.google.com/calendar/event?eid={event-id}&ctz={timezone}, you can retrieve it by using Calendar.Events.list() of Calendar API.When you use this modified script, please enable Calendar API at Advanced Google Services and API console.
function export_gcal_to_gsheet(){
var mycal = "info@neugier.schule";
var cal = CalendarApp.getCalendarById(mycal);
var today = new Date()
var thisweek = new Date (today.getTime())
var oneWeekfromNow = new Date(today.getTime() + (7*3600000*24));
var events = cal.getEvents(thisweek, oneWeekfromNow, {search: 'stammtisch'});
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Termine");
var header = [["Event Title", "Event Start", "Thema", "LinkZoom", "EventID"]]
var range = sheet.getRange(1,1,1,5);
range.setValues(header);
// Added
var items = Calendar.Events.list(mycal, {
timeMin: thisweek.toISOString(),
timeMax: oneWeekfromNow.toISOString(),
q: 'stammtisch'
}).items;
for (var i=0;i<events.length;i++) {
var row=i+2;
var myformula_placeholder = '';
var details=[[events[i].getTitle(), Utilities.formatDate(events[i].getStartTime(),'Europe/Berlin', 'dd.MM.yyyy,\' um\' HH:mm\'Uhr\''), events[i].getDescription(), events[i].getLocation(), items[i].htmlLink.split("=")[1]]]; // Modified
var range=sheet.getRange(row,1,1,5);
range.setValues(details);
}
}
htmlLink from Calendar.Events.list(). The link is https://www.google.com/calendar/event?eid={event-id}. Now I retrieved event-id from the link for matching your script using items[i].htmlLink.split("=")[1]. If you want the link, please modify it to items[i].htmlLink.If I misunderstand your question, I'm sorry.