Answer the question
In order to leave comments, you need to log in
Where is the error in the script? Why does the script "swear"?
Good day!
I automate the creation of events in the calendar from the table. Here is the code:
function SynsToCalendar() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("CALENDAR");
var lr = sheet.getLastRow();
var spreadsheet = SpreadsheetApp.getActiveSheet();
var calendarId = spreadsheet.getRange('E4').getValue();
if(sheet.geRange(10, 10).isChecked()===true){
var eventCal = CalendarApp.getCalendarById(calendarId);
var lr = spreadsheet.getLastRow();var count = spreadsheet.getRange("A8:F"+lr+"").getValues();
for (x=0; x<count.length; x++) {
var shift = count[x];
var summary = shift[0];
var startTime = shift[1];
var endTime = shift[2];
var guests = shift[3];
var description = shift[4];
var location = shift[5];
var event = {
'location': location,
'description': description,
'guests':guests +',',
'sendInvites': 'True',
}
eventCal.createEvent(summary, startTime, endTime, event);
sheet.getRange(10, 10).uncheck();
}
}
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question