Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

192
Views
Google Apps Script- Get Guest List from Calendar

I am having a hard time finding a way to get the emails of all the partecipants in the next events on my calendar.

I only get the email of only one partecipant

The final idea should be to color code the calendar based on who is in the meetings.

Here's what I got so far


  var today = new Date();
  var nextweek = new Date();
  nextweek.setDate(nextweek.getDate() + 7);
  Logger.log(today + " " + nextweek);

  var calendars = CalendarApp.getAllOwnedCalendars(); 
  Logger.log("found number of calendars: " + calendars.length); 



  for (var i=0; i<calendars.length; i++) { 
    var calendar = calendars[i];           
    var events = calendar.getEvents(today, nextweek); 
    for (var j=0; j<events.length; j++) {
      var e = events[j];
      var title = e.getTitle();
      var guestlist=events[j].getGuestList();
      var details=guestlist[j].getEmail();


        if (details == "example0@gmail.com") {
        e.setColor(CalendarApp.EventColor.CYAN);
      }
      if (details == "example1@gmail.com") {
        e.setColor(CalendarApp.EventColor.YELLOW);
      }
      if (details == 'example2@gmail.com') {
        e.setColor(CalendarApp.EventColor.GREEN);
      }
    }
  }
} ```


about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!