Hi everyone,
i create an automation with appscript. It is fine with creating of calendar event but it doesn’t set return value in the event id column.
I paste all off my steps
thank you for helping
ps sorry for my english ![]()
This is screen of Bot
And this is the code
/**
- Creates a new Calendar event in the specified calendar with title, startTime, endTime,
- and returns the event ID to be used in AppSheet automation.
- Parameters:
- title: The title of the event.
- startTime: The start time of the event, formatted as an ISO string including timezone.
- endTime: The end time of the event, formatted in the same way as startTime.
- calendarId: The ID of the calendar where the event should be created.
- Return:
- Object containing the event ID.
*/
function createCalendarEvent(title, startTime, endTime, calendarId) {
// Define the Rome timezone offset
var timeZoneOffset = ‘+02:00’; // For Central European Summer Time (CEST)
// During Standard Time, you would use ‘+01:00’.
// Append the timezone offset to the startTime and endTime if it’s not already included
if (!startTime.includes(‘+’)) {
startTime += timeZoneOffset;
}
if (!endTime.includes(‘+’)) {
endTime += timeZoneOffset;
}
// Parse the start and end times to Date objects with the timezone offset
let start = new Date(startTime);
let end = new Date(endTime);
// Get the calendar by the given ID or use the default calendar
let calendar = calendarId ? CalendarApp.getCalendarById(calendarId) : CalendarApp.getDefaultCalendar();
if (!calendar) {
throw new Error('Cannot find calendar with ID: ’ + calendarId);
}
// Create the event in the specified calendar
var event = calendar.createEvent(title, start, end);
Logger.log('Event created: ’ + event.getTitle() + ’ with Start: ’
- event.getStartTime().toString() + ’ and End: ’
- event.getEndTime().toString());
// Return the event ID to be used in AppSheet automation
return { ‘IdEvento’: event.getId() };
}



