I am attempting to have users answer questions in a Google Form, that is linked to a Google Sheet, and I have an Apps Script that will create a Google Calendar Event. I have an "On form submit" trigger setup so each time a new form is submitted, my App Script will run. However I'm a total newb and don't know how to make my script only pull data from the newly added row. Here is my script:
function createCalendarEvent() {
let RequestTimeOffCalendar = CalendarApp.getCalendarById("c_lb66r3ruc5jsg84m0vjv4tao04@group.calendar.google.com");
let sheet = SpreadsheetApp.getActiveSheet();
let schedule = sheet.getDataRange().getValues();
schedule.splice(0, 1);
schedule.forEach(function(entry) {
RequestTimeOffCalendar.createEvent(entry[1], entry[2], entry[4]);
});
}