TLDR; how do I skip empty cells instead of stopping?
I have a spreadsheet set up to create events in my calendar for a variety of tasks, and it works as expected unless a column is blank.
enter image description here
How can The second row worked fine. I had 5 events in my calendar as required. For line 1 I only need to add 3 tasks for that project to my calendar but the moment it gets to a blank, it stops completely and adds nothing further.
function tasksfunction() {
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(“Task Tracker”);
var tasktracker= spreadsheet.getRange(“A2:M2”).getValues();
CalendarApp.getCalendarById(‘XXXX.calendarurl’).createAllDayEvent(‘plain text: ‘+tasktracker[0][0],
tasktracker[0][6]
);
The above is repeated for each column.
}
It works PERFECTLY for me if there is a date in each column. But I don’t always need to do all 5 tasks for that project. Help!
First time coder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.