How to integrate Google spreadsheet with Google Calendar?

I have a Google spreadsheet in Google Apps. When I enter a date / time in a table, do I want to create an appropriate entry in a specific Google Calendar? How can i do this?

This thread offers some kind of script, but no complete solution is given. And I use Google Apps instead of Google Docs, as suggested in this thread.

Update . Thread detected .

+5
source share
1 answer
function caltest1() {
  var sheet = SpreadsheetApp.getActiveSheet();
  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.getDefaultCalendar();
  for (i in data) {
    var row = data[i];
    var title = row[0];  // First column
    var desc = row[1];       // Second column
    var tstart = row[2];
    var tstop = row[3];
    var loc = row[4];
    //cal.createEvent(title, new Date("March 3, 2010 08:00:00"), new Date("March 3, 2010 09:00:00"), {description:desc,location:loc});
    cal.createEvent(title, tstart, tstop, {description:desc,location:loc});
 }
}

Directly taken from here.

+4
source

All Articles