Concept demo by Alex Mercer. Copperwick Moving Co., its towns, staff and customers are made up. Example data, not client work, and nothing here sends real email.Back to Alex Mercer's portfolio
Script

Form → Sheet → Email automation · Google Apps Script

Quote requests that file themselves, find the right person and get a reply.

A made-up mover, Copperwick Moving Co., gets quote requests from a Google Form and from its website. This is the automation I'd set up for it: every request lands in one Google Sheet with a reference number, goes to the right estimator by town, and the customer gets a confirmation straight away. Repeats, typos and spam get caught, and if a request sits unanswered, someone hears about it.

Runs onGoogle Sheets, Forms and Gmail, through Apps Script
Cost to run$0 on a Google account. No Zapier or Make plan.
Checks per requestSpam, contact details, repeats, routing, priority
Automated tests33 passing, run offline

01 · How it works

Seven steps, in order, every time.

Each step is a small plain-JavaScript function in Rules.gs. The part that talks to Google (reading the sheet, sending mail) is kept separate in Code.gs, so the rules can be tested without a Google account, and the "Try it" box below runs the exact same file.

  1. 1

    Request comes in

    From a Google Form linked to the sheet, or the website's own form posting to the script.

  2. 2

    Spam check

    A hidden field only bots fill in, and a limit on links in the notes. Spam is logged, never emailed.

  3. 3

    Contact check

    Email format, common domain typos like gmial.com, phone length, a sane move date.

  4. 4

    Repeat check

    Same email or phone with an open request in the last 14 days? Update that row instead of adding one.

  5. 5

    Routing

    The town they're leaving picks the area and estimator. Long-distance moves go to one person.

  6. 6

    Priority + reply-by

    Moving within 7 days is Rush. The reply-by time counts business hours only, Mon to Sat, 8 to 6.

  7. 7

    Write and send

    One row on the sheet, an alert to the estimator, a confirmation to the customer.

Then, on a timer

Every hourAnything still New past its reply-by time gets one reminder, to the estimator and the office.
Every morning at 7A digest to the office: yesterday's count, open requests per estimator, what's overdue, who moves this week.

02 · Try it

Send a request and watch what the script does.

This runs Rules.gs and Emails.gs in your browser against a copy of the sheet. Nothing is sent anywhere: the emails are shown here instead. Pick an example or fill it in yourself.

Get a moving quoteThe form a customer fills in
processRequest() · run logwaiting
  1. Submit the form or pick an example to start.

Emails the script would send show up here.

Requests tab · newest at the bottom, like the real sheet

03 · The sheet

One Google Sheet, four tabs, no code to change settings.

The office works in the Requests tab and updates the Status column. Who covers which town, office hours, the reply window and the rush cutoff all live in tabs anyone can edit.

  • Columns are found by their header. Move them, hide them or add your own; the script looks each one up by name.
  • A Status dropdown with New, Contacted, Quoted, Booked, Lost, Check contact and Spam, so the reminders and the digest know what's still open.
  • Reply by is worked out from office hours, so a request at 9 PM on Saturday is due Monday morning, not in the middle of the night.
  • The Log tab keeps a line for every run, every skipped email and every error, with the request attached, so nothing is lost silently.

04 · The emails

Short, specific, written for the person reading.

The customer gets the details back and a name and time to expect a call. The estimator gets everything needed to phone them, with Rush and anything to double-check at the top. Each email has a plain-text version too.

05 · Follow-up

Nothing sits unanswered without someone hearing about it.

Two time-driven triggers do the chasing, so nobody has to remember to check the sheet.

06 · Edge cases

What happens when things go wrong.

Most small automations work on the happy path and break quietly on everything else. These are the cases I planned for. Each is handled in the code and checked by the tests in the repo, using stand-ins for Google's services.

Two requests in the same second

Each run takes a script lock first, so two submissions can't grab the same row or reference number. If the lock can't be had in 30 seconds, the request is written to the Log tab instead of dropped.

LockService

Gmail's daily limit

Apps Script can email 100 recipients a day on a free Google account and 1,500 on Workspace. The script checks what's left before every send; if it's out, the row is still saved and the skip goes in the Log.

getRemainingDailyQuota()

Someone rearranges the sheet

Columns are matched by header text, not position, so dragging "Phone" next to "Name" or adding a "Crew" column doesn't send data into the wrong place.

readRequests_()

The script itself fails

Any error is caught, the full request is saved to the Log with the error, and the office gets an email saying so. The customer's details are never only in a failed run.

handleRequest_()

A typo in the email

grace@gmial.com would bounce. The row is marked Check contact and the estimator is told, but no confirmation goes to the bad address.

validateRequest()

The same person, twice

People resubmit when they don't hear back. The second one updates the first row (new date, extra notes, a repeat count) and pings the estimator instead of making a second lead.

findDuplicate()

07 · Setup and handoff

About twenty minutes to install, and it's yours.

The script runs in the business's own Google account. No outside service, no monthly plan, nothing that stops working if I disappear.

  1. Make the sheet. Import the sample workbook into Google Sheets, or start from your own sheet; setup adds any missing tabs.
  2. Link the form. In Google Forms, Responses → Link to Sheets. Match the question titles in FORM_FIELDS if yours differ.
  3. Paste the script. Extensions → Apps Script, then add Code.gs, Rules.gs and Emails.gs.
  4. Fill in two tabs. Routing (town, area, estimator, email) and Settings (hours, reply window, rush cutoff, emails).
  5. Run setup() once and accept Google's permission prompt. It creates the three triggers and the Status dropdown.
  6. Optional: your website form. Deploy as a web app and point the site's form at it. Same rules, source shows "Website".
Rules.gs · the repeat check inside processRequest()
var dup = findDuplicate(req, ctx.rows, now, cfg);
if (dup) {
  var prev = dup.row;
  step('Duplicate check', 'Same ' + dup.on + ' as ' + prev.ref + ' (' + prev.status + '). Added to that row instead of making a new one.', 'warn');
  var merged = mergeIntoRow(prev, req, now, check);
  step('Sheet', 'Updated ' + prev.ref + ': repeat count ' + merged.repeats + ', newest details kept');
  if (prev.estimatorEmail) {
    emails.push({ to: prev.estimatorEmail, kind: 'repeat', ref: prev.ref });
    step('Email', 'Heads-up to ' + prev.estimator + ': this person asked again', 'mail');
  }
  step('Customer email', 'Not sent again (they already have ' + prev.ref + ')', 'skip');
  return { outcome: 'merged', row: merged, index: dup.index, emails: emails, log: log };
}
step('Duplicate check', 'No open request with this email or phone in the last ' + cfg.duplicateDays + ' days');
node --test tests/
✔ setup makes the tabs, headers, status dropdown and three triggers
✔ columns are found by header, even after someone moves them
✔ when the email quota is used up the row is still saved and the skip is logged
✔ the morning digest goes to the office
✔ if the lock is busy for 30 seconds, the request goes to the Log instead of being dropped
✔ a long-distance move goes to the long-distance person
✔ an unknown town goes to the office and is noted
✔ a broken email is held too
✔ past and far-out move dates are noted but still logged
✔ the same person again updates their row instead of adding one
✔ duplicates match on phone too, but not closed or old rows
✔ emails escape whatever people type
… 21 more

ℹ tests 33  ·  pass 33  ·  fail 0
ZIPThe Apps Script projectCode.gs, Rules.gs, Emails.gs, appsscript.json and the setup notes · 15 KB XLSXThe sample sheetRequests, Routing, Settings and Log tabs with the example data · 11 KB

Built and tested offline against stand-ins for Google's services (the tests are in the repo). It hasn't been installed for a real business, and no real email was sent.