[Product Demo] Spreadsheet-Based AI Lead Triage System (Google Chat & Apps Script Integration)
Introduction
"We waste an hour every day just reviewing collected information." "Automations reliant on external tools break immediately due to API changes or outages." For clients facing these pain points, we are releasing the design and code of HadayaLab's "Google Sheets x AI Triage System" as a portfolio demo.
This system eliminates complex service account authentication keys and expensive external libraries. Instead, it utilizes a highly lightweight and robust Google-native architecture that seamlessly integrates Google Sheets x Google Apps Script (GAS) x Gemini API.
1. Before & After: Resolving Operational Bottlenecks (BPR)
- Before (The Swamp of Manual Labor): Hundreds of leads collected via crawlers and APIs are manually copy-pasted and categorized one by one into spreadsheets or chat tools. Staff spend countless hours visually assessing suitability, selecting target applications, and drafting summary emails.
- After (Touchless Autonomous Environment): Data collected by crawlers is instantly upserted into Google Sheets via a backend API. Simultaneously, Gemini automatically appends a suitability score (0-100%), the rationale behind the decision, and a Before/After BPR proposal directly on the sheet. The CEO merely updates a dropdown to "GO" on their smartphone, which instantly triggers the Vercel-side automated proposal and mock UI generation engine.
2. System Architecture
This system is composed of the following three layers:
- Data Collection & AI Analysis (Next.js / Vercel Serverless): Utilizes the Gemini API (Google Generative AI) to diagnose the compatibility of collected leads (requirements, budget, duration) against the company's core values. It instantly generates the framework for a Before/After proposal.
- Database Middleware (GAS Web App Connector): To bypass complex OAuth authentication and service account management, a lightweight API connector (Apps Script) is deployed on the Google Sheets side. It directly receives POST requests from Next.js and renders the data automatically onto the sheet.
- Triage Console (Google Sheets Triage Board): Features a dropdown menu in an automatically generated "CEO Judgment" column (Pending, Keep, GO, Pass). It also includes a strategy memo column for two-way integration with NotebookLM, enabling seamless collaboration between AI and humans directly on the sheet.
3. Public GAS Integration Code (Google Apps Script)
Below is the actual Google Apps Script code used in this system. By simply pasting this into your Google Spreadsheet's "Extensions -> Apps Script," your spreadsheet transforms into an AI command center (API endpoint).
function doPost(e) {
try {
var data = JSON.parse(e.postData.contents);
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
if (data.action === "sync_jobs") {
var result = syncJobs(sheet, data.jobs);
return ContentService.createTextOutput(JSON.stringify({ success: true, message: result }));
}
} catch (err) {
return ContentService.createTextOutput(JSON.stringify({ success: false, error: err.toString() }));
}
}
function syncJobs(sheet, jobs) {
// Automatically initialize headers and data validation
if (sheet.getLastRow() === 0) {
var headers = ["ID", "Collected At", "Platform", "Project Name", "Project URL", "Budget", "AI Match Score", "AI Rationale", "CEO Judgment", "Before", "After", "Mock UI Preview URL"];
sheet.appendRow(headers);
sheet.getRange("A1:L1").setFontWeight("bold").setBackground("#f3f4f6");
}
// (Omitted) ... Check for duplicate IDs and perform row insertions or diff updates.
}
4. Key Highlights of this Product Demo
- No-Code UI Deployment: By connecting this spreadsheet to Google Cloud's AppSheet, you can launch a dedicated smartphone triage app in just one minute, allowing you to "swipe right for GO, swipe left for Pass" completely free of charge.
- NotebookLM Synergy: The spreadsheet content can automatically sync with NotebookLM via Google Drive, fully linking your strategic AI podcast with your data.
HadayaLab provides Google-native BPR solutions designed to "eliminate unnecessary operational tasks and allow humans to focus on judgment." With our free "Process Diagnosis Map," we can guide your manual operations toward complete automation in as little as three days.