Reputation: 329
This is probably a Type
issue, but I just can't seem to solve it.
The code, running from Sheets, based on this:
var eventdescription = 'test';
var event = CalendarApp.getCalendarById(calendarid).createEvent(
eventtitle,
startfull,
endfull,
{description: eventdescription},
{location: eventaddress.toString()}
);
The error:
Cannot find method createEvent(string,object,object,object,object).
I had a similar issue with the location
but this was solved by adding toString()
. With the description
, I cannot seem to find a solution. Isn't it a string
as well? It doesn't work with or without the toString()
.
Omitting the {description: eventdescription},
allows the script to run with no issues, but of course with no description in the event.
Any ideas how to make it work? Thanks!
Upvotes: 1
Views: 871
Reputation: 26826
var eventdescription = 'test';
var event = CalendarApp.getCalendarById(calendarid).createEvent(
eventtitle,
startfull,
endfull,
{description: eventdescription, location: eventaddress.toString()}
);
Upvotes: 2