The Smart Request Approval System is a digital workflow “messenger” that:
- Collects request data from employees
- Routes it to the correct manager for approval
- Notifies the employee of the final decision
It is a serverless orchestration system integrating:
- Google Forms
- Google Sheets
- Gmail
- Google Apps Script (Web App Service)
The workflow operates on an event-driven model:
- 📌 Google Sheet → Central database
- ⚙️ Apps Script → Backend business logic
Source:
A multi-layered and structured Google Form with integrated validation collects data.
Primary Trigger:
onFormSubmit installable trigger
Logic:
Upon submission, the script extracts the e.values object containing user responses.
This system does not send emails to a fixed recipient — it routes dynamically.
The script queries a “Staff” sheet to find the submitter’s manager email using VLOOKUP-style logic in JavaScript.
Instead of opening a spreadsheet, managers receive an interactive email.
Uses:HtmlService.createTemplateFromFile()
To generate professional emails with:
- APPROVE button
- REJECT button
Buttons link to a published Apps Script Web App URL.
When a manager clicks a button:
- The Web App’s
doGet(e)function is triggered - The script reads URL parameters (
action,id) - The corresponding row in the Sheet is updated
Open the Google Form and complete all required fields.
All fields are mandatory unless marked Optional.
Requester Name
Must be full name (minimum two words, e.g., “Narendra Modi”).
Manager’s Email
Must be a valid email format.
Request Type
Choose from:
- Leave
- Access
- IT Support
- Travel
- Budget
- Other
If Leave is selected:
- Leave Start Date
- Leave End Date
Priority
- Urgent
- Non-Urgent
Request Description
- Clear explanation
- Maximum 999 characters
Supporting Attachment (Optional)
- Max 1 file
- Max size: 10MB
- Accepted formats: PDF, receipt, screenshot, etc.
- (Optional) Toggle “Send me a copy of my responses”
- Review your entries
- Click Submit
- You receive a submission copy (if selected)
- Your manager receives an approval request
- You receive an automated Approved/Rejected email with decision date
You will receive an email with subject: [Priority] New [Type] Request from [Name]
Steps:
- Review request details in the email
- Click View Attachment (if provided)
- Click:
- APPROVE
- REJECT
After clicking a button:
- A browser tab confirms your action
If already processed:
- The system displays an "Already Processed" warning
- Prevents duplicate approvals or accidental changes
- The
Code.gsfile contains aCOLSconfiguration block - If a Form question title changes, update the
COLSconstant
- All decisions and timestamps are logged in Google Sheets
Any logic change requires:
- New Web App Deployment
- Updating the
WEB_APP_URLconstant
| Issue | Cause | Solution |
|---|---|---|
| "Already Processed" Warning | Link clicked twice or email security scanner pre-clicked it | Check Google Sheet for current status. No further action required. |
| "Error" Card in Web App | try...catch block captured failure (e.g., sheet deleted, renamed column) |
Check the Apps Script Executions tab. Ensure column headers exactly match COLS config. |
| Manager sees "Invalid Request" | if (!e.parameter.row) triggered (URL opened directly without parameters) |
Ensure manager clicks the full link inside the email. |
| Email buttons don't work | WEB_APP_URL points to old or expired deployment |
Redeploy as New Version, copy new URL, update WEB_APP_URL constant. |
