Google Spreadsheet to Calendar issue -
here script. appears run when go press push calendar cannot seem work. have tried number of things , have failed far. appreciated. please , thank you.
function onopen() { var ss = spreadsheetapp.getactivespreadsheet(); var menuentries = [ {name: "add calendar", functionname: "pushtocalendar"} ]; ss.addmenu("autocalendar", menuentries); } //push new events calendar function pushtocalendar() { //spreadsheet variables var sheet = spreadsheetapp.getactivesheet(); var calendar = calendarapp.getcalendarbyid('athomas12033@gmail.com')[0]; var numrows = sheet.getlastrow() var updaterange = sheet.getrange('l1'); var cell = spreadsheetapp.getactiverange(); var cellcol = cell.getcolumn(); var cellrow = cell.getrow(); var numrows = sheet.getlastrow(); var datarange = sheet.getrange(1, 1,sheet.getlastrow(), 13); var data = datarange.getvalues(); (i in data) { var row = data[i]; var name = row[0]; var type = row[3]; var datereq = row[4]; var tstart = row[5]; var tstop = row[6]; } if (tstop == " ") { var tstop = tstart; } //show updating message updaterange.setfontcolor('blue'); var title = row[7]; if (title == " ") { var title = type; var narr = ""; } else { var narr = row[8]; } var meet = row[9]; var realname = row[2]; var contact = row[10]; var appr = row[12]; if (appr == "y") { cal.createevent(title, new date(datereq+" "+tstart), new date(datereq+" "+tstop), {description:type+"\n"+narr+"\n"+realname+", "+contact,location:meet,guests:name,sendinvites:true}); } // delete approved programs. (var delrow = 1; delrow < numrows; delrow++) { var range = sheet.getrange(delrow,14,1,1); if (range.getvalues() == "y") { sheet.deleterow(delrow); var delrow = delrow-1; } } }
Comments
Post a Comment