title: Creating calendar event in sheets using Google App Script and want to add attendees
body: <p>I'm trying to create calendar events in sheets using Google App Script (I'm very new to this). The sheet contains details of the event (date, time, event title, and guest list) as well as the calendar ID (this is a training calendar). I want to make it simple for the end-user to fill in the information on the sheet, click 'schedule now' and the script run and send the events out to all email addresses mentioned in the guest list.</p>
  <p>Here is an example of the sheet:</p>
  <img src="https://i.stack.imgur.com/Ly9cK.png">
  <p>Here is a copy of the code (I found this on the Google Developer website and tried to adapt it to add guests but haven't been able to get it working and really not sure where to go with this. Ideally, I'd like the guest list to come from the sheet and not be written into the code as an option.</p>
  <pre><code>function scheduleTraining() {
  
    var spreadsheet = SpreadsheetApp.getActiveSheet();
    var calendarId = spreadsheet.getRange(&quot;C3&quot;).getValue();
    var eventCal = CalendarApp.getCalendarById(calendarId);
    
    Logger.log(eventCal)
    
    var signups = spreadsheet.getRange(&quot;A5:C20&quot;).getValues();
   
    for (x=0; x&lt;signups.length; x++) {
      
      var shift = signups[x];
      
      var startTime = shift[0]
      var endTime = shift[1]
      var title = shift[2]
      
      eventCal.createEvent(title, startTime, endTime, {
        location: 'remote',
        description: 'snacks provided',
      })
    }
    
  }  
  
  function onOpen(e) {
    SpreadsheetApp.getUi()
        .createMenu('Schedule Training')
        .addItem('Schedule Now', 'scheduleTraining')
        .addToUi();
  }
  </code></pre>
  <p>If anyone can help with this or has any ideas on how to do this better, I'm all ears!</p>
  <p>Thanks!</p>