Skip to content

Google Sheets

Read and write a Google Sheet. Primarily used for the induction roster import and sync, which is a job schools already do in a spreadsheet.

CategorySpreadsheet
AuthenticationService account, optionally with delegation
Reachesoauth2.googleapis.com, sheets.googleapis.com
Needs an agentNo
Demo modeYes

sheet.read, sheet.write

The same flow as Google Workspace and Chrome Enterprise. Reuse an existing service account if you have one.

  1. Google Cloud console, in a project for your school.
  2. IAM and Admin, Service Accounts, Create service account. Name it plugboard.
  3. Keys, Add key, Create new key, JSON. Download it.
  4. Enable the Google Sheets API for the project under APIs and Services, Library.

Two ways, and the first is simpler.

Share the sheet directly. Open the spreadsheet, click Share, and share it with the service account’s client_email address as an Editor. No delegation needed. Leave subject empty in the configuration.

Domain-wide delegation. If you would rather the service account act as a person, grant delegation as described for Chrome Enterprise with the scope https://www.googleapis.com/auth/spreadsheets, and set subject to that person’s address.

Sharing the sheet is less powerful and less to go wrong. Use it unless you have a reason not to.

Admin, Connectors, Google Sheets, Configure.

FieldDefaultValue
spreadsheetIdemptyThe id from the sheet’s URL
tabInductionsThe worksheet or tab name
rangeA1:Z1000The A1 range within the tab
subjectemptyAn optional delegated user to act as
demoModefalseReturn fixture data

The spreadsheet id is the long string in the URL between /d/ and /edit:

https://docs.google.com/spreadsheets/d/1AbC...XyZ/edit#gid=0
^^^^^^^^^^ this
FieldValue
clientEmailclient_email from the downloaded JSON
privateKeyprivate_key from the JSON, including the BEGIN and END lines

Save and test.

Keep the header row in the first row of the range. The columns that matter are the ones identifying a student and, if you are tracking it, the device they are being issued.

Practical advice from schools that do this every January:

  • One tab per year, not one sheet per year. Change the tab setting and the history stays in the same file.
  • Do not merge cells. A merged cell reads as a blank in every row but the first.
  • Leave the range generous. A1:Z1000 covers a large year group and costs nothing.
  • Freeze the header row so whoever is editing it during handout week does not scroll it away and start typing in the wrong column.

Because that is what schools use for this. A device handout list gets built in a spreadsheet by somebody in the office, edited by three people, and printed. Making Plugboard read that sheet is less work and less friction than making everybody change how they work in the busiest week of the year.

Once the roster is imported, the tracking happens in Plugboard. See inductions.

SymptomCause
403The sheet is not shared with the service account, or delegation is not authorised
404Wrong spreadsheet id. Check you copied the id and not the whole URL
“Unable to parse range”The tab name does not match. It is case sensitive and spaces count
Empty resultThe range does not cover the data, or the tab is empty
invalid_grantThe private key is malformed. Paste it complete
Sheets API not enabledEnable it in the Cloud console for the project
Fixture rows appeardemoMode is still on