Want to add your Google Calendar Data to Google Sheets?
function getEvents() {
var ss = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var cal = CalendarApp.getCalendarById(“kanza.akhwand@yayvo.com”);
var events = cal.getEvents(new Date(“07/01/2020 12:00 AM”), new Date(“07/31/2020 11:59 PM”));
for(var i = 0;i<events.length;i++){
var title = events[i].getTitle();
var sd = events[i].getStartTime()
var ed = events[i].getEndTime();
var loc = events[i].getLocation();
var desc = events[i].getLocation();
Logger.log(title);
ss.getRange(i+2, 1).setValue(title);
ss.getRange(i+2, 2).setValue(sd);
ss.getRange(i+2, 3).setValue(ed);
ss.getRange(i+2, 4).setValue(loc);
ss.getRange(i+2, 5).setValue(desc);
}
}