Trigger an onboarding sequence on form submit
Kick off tasks when a new Northwind hire submits their starter form.
Published Oct 17, 2025
The first day of a new Northwind hire is also the day three or four people remember they were supposed to set something up. A Drive folder, a row on the onboarding tracker, a welcome email — all small jobs, all easily forgotten. Doing them by hand for every joiner is fine while you hire twice a year, then quickly becomes a mess once hiring picks up.
This script turns one form submission into the whole opening sequence. The new hire fills in their starter form; on submit, the script provisions their personal folder, adds them to the onboarding queue, and sends a welcome email with their first link. The people coordinator only steps in when something needs a human.
What you’ll need
- A Google Form with three questions titled exactly
Name,Email, andRole— these become the keys ine.namedValues. - A Drive folder where each hire’s folder will live, with the script owner as
an editor. Save its ID in
HIRES_PARENT_FOLDER. - A Google Sheet acting as the onboarding tracker, with a header row matching
the columns the script appends. Save its ID in
ONBOARDING_SHEET. - A form-submit trigger pointing at
onFormSubmit.
The script
// Drive folder where each new hire gets a sub-folder.
const HIRES_PARENT_FOLDER = '1abcHiresFolderId';
// Sheet that tracks the onboarding queue. Columns: date, name, email, role,
// folder, status.
const ONBOARDING_SHEET = '1abcOnboardingId';
// Who signs the welcome email.
const SIGNATURE = '— Awadesh';
// Starting status for every new row.
const INITIAL_STATUS = 'pending';
/**
* Form-submit handler. Spins up a folder, queues the hire, and welcomes them.
*
* @param {GoogleAppsScript.Events.FormsOnFormSubmit} e
*/
function onFormSubmit(e) {
// 1. Pull the answers out of the event. Each value is an array because
// Forms supports multi-select; for these single-answer questions we
// want the first entry.
const name = e.namedValues.Name?.[0];
const email = e.namedValues.Email?.[0];
const role = e.namedValues.Role?.[0];
// 2. Bail out cleanly if any required field is missing — better a clear log
// line than a half-provisioned hire.
if (!name || !email || !role) {
Logger.log(`Skipping submission with missing fields: ${JSON.stringify(e.namedValues)}`);
return;
}
// 3. Create the hire's personal folder under the shared parent and give
// them editor access on it.
const folder = DriveApp.getFolderById(HIRES_PARENT_FOLDER).createFolder(name);
folder.addEditor(email);
// 4. Append a row to the onboarding tracker. The status column starts as
// "pending" so the coordinator can see at a glance what is open.
SpreadsheetApp.openById(ONBOARDING_SHEET)
.getSheets()[0]
.appendRow([new Date(), name, email, role, folder.getUrl(), INITIAL_STATUS]);
// 5. Welcome email. Plain text — the link to their folder is the only
// interactive bit so it does not need to be HTML.
const subject = 'Welcome to Northwind';
const body =
`Hi ${name},\n\n` +
`Welcome aboard. Here is your starter folder — it is yours, share what you like:\n` +
`${folder.getUrl()}\n\n` +
`You are joining as ${role}. We will see you on Monday.\n\n` +
SIGNATURE;
GmailApp.sendEmail(email, subject, body);
Logger.log(`Onboarded ${name} <${email}> as ${role}.`);
}
How it works
- The form-submit trigger fires
onFormSubmitwith an event object whosenamedValuesholds each answer keyed by question title. - The script reads
Name,Email, andRole, taking the first entry from each array. If any of the three is missing, it logs and returns — better than provisioning a half-broken record. - It creates a sub-folder named after the hire inside the shared hires
parent, then calls
addEditorso the new joiner can drop documents into their own space from day one. - It appends a row to the onboarding sheet with a timestamp, the hire’s
details, the folder URL, and a starting status of
pending. That row is the work item the people coordinator picks up next. - It sends a plain-text welcome email with the folder link inline. Gmail auto-links the URL so the hire can click straight through.
- A single log line at the end gives the executions panel a clear “this hire was set up” record — useful when you are debugging which run did what.
Example run
A new hire submits the starter form with:
| Question | Answer |
|---|---|
| Name | Mei Tanaka |
| [email protected] | |
| Role | Product designer |
Within seconds:
- A Drive folder named
Mei Tanakaappears under the hires parent folder, with[email protected]added as editor. - A new row lands on the onboarding sheet:
| Date | Name | Role | Folder | Status | |
|---|---|---|---|---|---|
| 2025-10-17 09:12 | Mei Tanaka | [email protected] | Product designer | https://drive.google.com/… | pending |
- Mei receives an email titled “Welcome to Northwind” with the folder link and a one-line note about Monday.
Trigger it
This needs an installable on-submit trigger — the simple onFormSubmit name
is not enough when the script touches Drive, Sheets, and Gmail.
- In the Apps Script editor, open Triggers (clock icon, left sidebar).
- Click Add trigger and choose
onFormSubmit. - Event source: From form. Event type: On form submit.
- Save and approve the authorisation prompts.
Watch out for
- Question titles are the contract. Rename
RoletoJob titlein the form and the script silently skips every submission. Either freeze the titles or switch toe.valuesindexed by position. - Folder names collide. Two hires called Sam will both get a
Samfolder unless you suffix the name with the role or a hire date. Drive allows duplicate folder names but humans hate it. - Email deliverability. The welcome email is sent as the script owner — if the owner is a personal account, expect occasional spam-folder delivery. Bind the script to a workspace user, or send via a Google Group alias.
- Re-runs duplicate work. Trigger glitches occasionally fire twice for the same submission. Add an idempotency check — look up the email in the onboarding sheet before appending — if duplicate folders would actually hurt.
Related
Build a content-submission queue
Collect Northwind guest posts or ideas for review through a Form.
Updated Oct 9, 2025
Score sentiment in open-text feedback
Rate Northwind feedback comments without manual review — using the in-Sheet sentiment function.
Updated Oct 5, 2025
Build a peer-nomination and voting system
Collect and tally Northwind nominations for awards or initiatives — one ballot, anonymous.
Updated Oct 1, 2025
Roll a form over each cycle
Archive old responses and reset for the next Northwind cycle — quarterly OKR check-ins.
Updated Sep 27, 2025
Build an RSVP system with live headcounts
Track attendance and dietary needs for Northwind events — running count, live.
Updated Sep 23, 2025