davepar / gcalendarsync

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

Custom event title #39

Open ghost opened 6 years ago

ghost commented 6 years ago

Hi! First of all, very nice script! My problem is, that events that are created get the title from one cell, but I would like to set a custom title like so: var title = sheetName+" no."+row[1]+" inspection"; How would I achieve this in your script? Another problem I'm having is that I'm not able to set how many header rows I have, my spreadsheet has 7 header row and on the 7th row there are the id, title, starttime and so on... Also, is it possible to remove all the script used for calendar-to-spreadsheet sync? I only need to sync events from spreadsheet to calendar and don't want to have someone accidentally doing it the other way around! Thanks again! Cheers!

ghost commented 6 years ago

Here is an example sheet with realistic data: https://docs.google.com/spreadsheets/d/12oW-OoxGCk1rgpgGkzp2aGFf9Ryhw9FpovlfDQMvvLE/edit?usp=sharing

What I'm trying to do is add all rows to the calendar and if the date changes remove the previous event and create a new one, every event should be an All Day event, so I don't need to use the endtime. Right now I did minimal changes to the script but it gives me an error :/

[18-02-20 06:29:15:563 PST] Starting execution
[18-02-20 06:29:15:794 PST] CalendarApp.getCalendarById([1o2go154a7u1qv8imq3rrmunhs@group.calendar.google.com]) [0.222 seconds]
[18-02-20 06:29:15:894 PST] Calendar.getEvents([Wed Dec 31 14:00:00 PST 1969, Thu Dec 31 14:00:00 PST 2499]) [0.099 seconds]
[18-02-20 06:29:15:895 PST] CalendarEvent.getId() [0 seconds]
[18-02-20 06:29:15:896 PST] CalendarEvent.getId() [0 seconds]
[18-02-20 06:29:15:896 PST] CalendarEvent.getId() [0 seconds]
[18-02-20 06:29:15:896 PST] CalendarEvent.getId() [0 seconds]
[18-02-20 06:29:15:897 PST] CalendarEvent.getId() [0 seconds]
[18-02-20 06:29:15:897 PST] CalendarEvent.getId() [0 seconds]
[18-02-20 06:29:15:898 PST] SpreadsheetApp.getActiveSpreadsheet() [0 seconds]
[18-02-20 06:29:15:899 PST] Spreadsheet.getActiveSheet() [0 seconds]
[18-02-20 06:29:16:007 PST] Sheet.getDataRange() [0.107 seconds]
[18-02-20 06:29:16:067 PST] Range.getValues() [0.06 seconds]
[18-02-20 06:29:16:069 PST] Range.offset([0, -1, 19, 1]) [0 seconds]
[18-02-20 06:29:16:123 PST] Execution failed: The coordinates or dimensions of the range are invalid. (line 326, file "Code") [0.498 seconds total runtime]

Any help would be greatly appreciated :)