As soon as an appointment is created in the calendar, a chat is automatically created with the people invited. For example: 10 minutes before the start, the chat appears in Google Chat on the left-hand side.
I would like this to be included in the following script.
I would be happy if you have a solution for this.
function invite() {
let sheet = SpreadsheetApp.getActiveSheet();
let events = SpreadsheetApp.getActiveSpreadsheet().getRangeByName("events").getValues();
let alreadyCreated = [];
let newEvents = []
events.forEach(function(e){
if(e[14]){
alreadyCreated.push(e[27])
}else{
newEvents.unshift(e[27])
}
});
events.forEach(function(e, index){
let calendar = CalendarApp.getCalendarById("myID");
if(!e[14]){
calendar.createEvent(
e[27],
new Date(e[19]),
new Date(e[20]),
{description: e[26],guests: e[17],sendInvites: true}
);
let newIndex = index+6
sheet.getRange("P"+ newIndex).setValue('true')
}
})
}
function getid(){
let calendarIDFromCell = SpreadsheetApp.getActiveSpreadsheet().getRangeByName("id").getValue();
Logger.log(calendarIDFromCell)
}