davepar / gcalendarsync

Apps Script for syncing a Google Spreadsheet with Google Calendar
MIT License
161 stars 46 forks source link

ignoring timestamp column #26

Open tmwhispe opened 7 years ago

tmwhispe commented 7 years ago

Hi -- this works way better than what I was using before, however using google forms as a way of populating the spreadsheet also introduces a 'timestamp' column, which then is entered into the calendar as an "undefined" event at the date and time of submission -- I have the code I was using before that allowed it to ignore the timestamp column, however I am not able to figure out where to put it in your code (which is much more advanced than the previous code), in order for it to work... I removed the calendar ID as it is a work calendar -- but I do know that's what needs to go in the 'ID' space.

var startRow = 2; // First row of data to process var numRows = 2; // Number of rows to process var dataRange = sheet.getRange(startRow, 1, numRows, 5); var data = dataRange.getValues(); var cal = CalendarApp.getCalendarById('ID') for (i in data) { var row = data[i]; var title = row[1]; // First column var desc = row[4]; // Fourth column var tstart = row[2]; var tstop = row[3];

davepar commented 6 years ago

This script will ignore any column that it doesn't recognize, and "timestamp" falls into that unrecognized group. It might be that the "undefined" is caused by a different issue. Did you set up a "title" column?