Created
February 8, 2018 18:47
-
-
Save anonymous/279f645e39fc57bbc5ddc48e657cfdc4 to your computer and use it in GitHub Desktop.
Google App Script - CalendarApp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function CalendarTest() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = ss.getActiveSheet(); | |
var index = 2; | |
var lastRow = sheet.getLastRow(); | |
for (;index <= lastRow; index++){ | |
var title = sheet.getRange(index, 1, 1, 1).getValue(); | |
var startTime = sheet.getRange(index, 2, 1, 1).getValue(); | |
var endTime = sheet.getRange(index, 3, 1, 1).getValue(); | |
var description = sheet.getRange(index, 4, 1, 1).getValue(); | |
var location = sheet.getRange(index, 5, 1, 1).getValue(); | |
var guests = sheet.getRange(index, 6, 1, 1).getValue(); | |
var sendInvites = true; | |
var calendar = CalendarApp.getCalendarById("YOUR-EMAIL-ID-HERE@YOUR-ORG-NAME.com").createEvent(title, startTime, endTime, | |
{description: description, location: location, guests: guests, sendInvites: sendInvites }); | |
}// End of for Loop | |
}// End of CalendarTest Function | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment