← Back to Portfolio

Online Leave Application & Approval System

Systems Architect

The Challenge

A digitised leave management system replacing a fully manual paper process, built on Google Forms, Apps Script, and Google Sheets.

The Engineering Win

Uses spreadsheet column edits as a state machine to drive a three-stage sequential approval chain, Head of Unit, Administration, then Zonal Coordinator, with each notification email carrying the cumulative approval history so no approver has to hunt for prior remarks. A daily maintenance trigger automatically sends return-to-duty reminders and closes out completed leave records with no manual follow-up.

Column-edit state machine driving sequential chain-of-command approval

function onEditTrigger(e) {
  const sheet = e.range.getSheet();
  if (sheet.getName() !== CONFIG.SHEET_NAME) return;

  const col = e.range.getColumn();
  const row = e.range.getRow();
  const rowVals = sheet.getRange(row, 1, 1, C.STATUS_COL).getValues()[0];

  // Each stage only fires on its own column, so an edit anywhere
  // else on the row can never skip or repeat a step in the chain.
  if (col === C.HOU_REC) {
    notifyNextApprover(CONFIG.ADMIN_EMAILS, rowVals, "Awaiting Admin Review");
  } else if (col === C.ADMIN_DECISION) {
    notifyNextApprover([CONFIG.ZC_EMAIL], rowVals, "Awaiting Final Approval");
  } else if (col === C.ZONAL_DECISION) {
    finalizeDecision(sheet, row, rowVals);
  }
}

See It In Use

New leave request notification, awaiting Head of Unit review

New leave request notification, awaiting Head of Unit review

Head of Unit recommendation, routed to Administration

Head of Unit recommendation, routed to Administration

Admin clearance, routed to Zonal Coordinator for final approval

Admin clearance, routed to Zonal Coordinator for final approval

Final decision notification with full approval history

Final decision notification with full approval history

Auto-generated official leave approval letter

Auto-generated official leave approval letter

Quantifiable Result

Replaced a fully manual, paper-based leave process for a 500+ staff workforce with a fully automated, auditable digital workflow.

Full Capabilities

  • Online application via Google Form with attached passport photo and supporting document
  • Three-stage sequential approval chain: Head of Unit, Administration, Zonal Coordinator
  • Cumulative approval history included in every notification email
  • Auto-generated official leave letter from a Google Docs template on final decision
  • Calendar sync with automatic staff invite on approval
  • Automated return-to-duty reminders and status closeout

Tech Stack

Google Apps ScriptGoogle FormsGoogle Docs APIGoogle Calendar API