Hello All,
I have a very basic understanding of scripts and I'm looking for a bit of assistance.
I have a script I'm using to add events from sheets to a public google calendar. The intent of the calendar is to show all approved travel to a particular site. Despite an error I get ("Cannot find method createEvent(string,string,string,object). (line 26, file "CalendarEvent") the script does seem to work (I can at least see the events on the calendar). One issue I'm having is it's creating duplicate events.
Here's my script so far:
function CreateBPEvent() {
var spreadsheet = SpreadsheetApp.getActiveSheet();
var calendarId = spreadsheet.getRange('AB1').getValue();
var eventCal = CalendarApp.getCalendarById("###");
var lr = spreadsheet.getLastRow();
Logger.log(lr);
var count = spreadsheet.getRange("Z3:AC"+lr+"").getValues();
for (x=0; x<count.length; x++) {
var shift = count[x];
var title = shift[0];
var startTime = shift[1];
var endTime = shift[2];
var description = shift[3];
var options = {
'description': description,
}
eventCal.createEvent(title, startTime, endTime, options);
}
}
I appreciate your help!
Confidentiality Notice:
The information contained in the communication and any attachments may contain confidential and legally protected information that is intended only for the use of the addressee. It is the property of Relish Labs, LLC. Unauthorized use, disclosure, dissemination or copying of this communication is strictly prohibited and may be unlawful. If you have received this message in error please notify the sender immediately and destroy this communication and all copies, including attachments. --
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/f9529deb-3a79-4e96-89b5-146636740605%40googlegroups.com.