This is the gatsby-styled-blog-starter demo site. To download the code and get some instructions visit the Github repository . To be informed about updates follow @greglobinski

Installable Triggers

Installable triggers provide a lot more function than the built in simple triggers

September 14, 2017

How to use installable triggers with Google Apps Script.

This project is based on a Google Form about a club signup. These kinds of signups always provide students with a first, second, and third choice. However, someone always has to go through and match those things up!

I wanted to create a system that automatically fills the club rosters with students first available choice based on when they sign up.

It is also a great way to demonstrate the installable trigger onSubmit(e) that you can use to run code when a user submits a form. Check out the code below:

function formSubmit(e) {
  var choices = [
    e.namedValues['First Choice'][0],
    e.namedValues['Second Choice'][0],
    e.namedValues['Third Choice'][0]

  var studentData = [e.values[1], e.values[2]];

  var ss = SpreadsheetApp.getActiveSpreadsheet();

  var studentNeedsGroup = true;

  while(studentNeedsGroup) {
    var i = 0;
    if(!isGroupFull(choices[i])) {
      if(ss.getSheetByName(choices[i])) {
      } else {

      studentNeedsGroup = false;

function isGroupFull(group) {
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(group);

  if(sheet) {
    return sheet.getDataRange().getValues().length >= 10 ? true : false;
  } else {
    return false;

If you have any suggestions or questions, let me know in the comments below!


jordan rhea I started as a teacher and taught myself to code with Python and JavaScript. Now I am passionate about sharing code and strategies to make teachers (and other G Suite users) as effective as possible with technology.

© jordan rhea 2018