DEV Community

Thesius Code
Thesius Code

Posted on • Originally published at datanest-stores.pages.dev

Google Apps Script Starter Kit

Google Apps Script Starter Kit

20+ production-ready Google Apps Script automations for email workflows, form processing, data synchronization, report generation, and calendar management. Copy, paste, and customize — each script is self-contained with inline documentation.

Key Features

  • Email Automation — scheduled digests, template-based sends, auto-replies, attachment processing
  • Form Processing — response routing, conditional notifications, data validation, auto-formatting
  • Data Sync — cross-sheet consolidation, API imports (JSON/CSV), scheduled refreshes, changelog tracking
  • Report Generation — PDF export, chart snapshots, email distribution, scheduled runs
  • Calendar Management — event creation from sheet data, availability checks, meeting summaries
  • Trigger Management — time-driven, on-edit, on-form-submit triggers with error logging

What's Included

File Description
src/email_automations.js 5 email workflow scripts (digest, template send, auto-reply, attachment saver, bounce handler)
src/form_processors.js 4 form scripts (response router, validator, conditional notifier, auto-formatter)
src/data_sync.js 5 data sync scripts (cross-sheet merge, JSON API import, CSV fetch, changelog, dedup)
src/report_generator.js 3 report scripts (PDF export, chart snapshot mailer, scheduled summary)
src/calendar_tools.js 3 calendar scripts (event creator, availability checker, meeting notes)
src/utilities.js Shared helpers (logging, error handling, config reader, rate limiter)
config.example.yaml Configuration template for all scripts
examples/ Ready-to-use example configurations

Quick Start

  1. Open your Google Sheet → ExtensionsApps Script
  2. Copy the desired script from src/ into the Apps Script editor
  3. Update the configuration constants at the top of each script
  4. Run the setup() function once to initialize triggers
  5. Test with runManual() before enabling automated triggers

Script Examples

Scheduled Email Digest

function sendDailyDigest() {
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Tasks");
  const data = sheet.getDataRange().getValues();
  const today = new Date();

  // Filter rows where due date is today and status is not "Done"
  const dueTasks = data.filter(row => {
    const dueDate = new Date(row[3]); // Column D = due date
    return dueDate.toDateString() === today.toDateString() && row[4] !== "Done";
  });

  if (dueTasks.length === 0) return;

  const html = dueTasks.map(task =>
    `<tr><td>${task[0]}</td><td>${task[1]}</td><td>${task[2]}</td></tr>`
  ).join("");

  MailApp.sendEmail({
    to: Session.getActiveUser().getEmail(),
    subject: `Daily Digest: ${dueTasks.length} tasks due today`,
    htmlBody: `<table border="1"><tr><th>Task</th><th>Owner</th><th>Priority</th></tr>${html}</table>`
  });
}
Enter fullscreen mode Exit fullscreen mode

Cross-Sheet Data Sync

function syncDataAcrossSheets() {
  const CONFIG = {
    sourceId: "YOUR_SOURCE_SHEET_ID",
    sourceTab: "Master",
    targetTab: "Local Copy",
    keyColumn: 0, // Column A as unique key
    syncColumns: [1, 2, 3, 4] // Columns B-E
  };

  const source = SpreadsheetApp.openById(CONFIG.sourceId)
    .getSheetByName(CONFIG.sourceTab).getDataRange().getValues();
  const target = SpreadsheetApp.getActiveSpreadsheet()
    .getSheetByName(CONFIG.targetTab);
  const existing = target.getDataRange().getValues();

  const existingKeys = new Set(existing.map(row => row[CONFIG.keyColumn]));
  const newRows = source.filter(row => !existingKeys.has(row[CONFIG.keyColumn]));

  if (newRows.length > 0) {
    target.getRange(target.getLastRow() + 1, 1, newRows.length, newRows[0].length)
      .setValues(newRows);
    Logger.log(`Synced ${newRows.length} new rows`);
  }
}
Enter fullscreen mode Exit fullscreen mode

JSON API Import

function importApiData() {
  const url = "https://api.example.com/v1/data?key=YOUR_API_KEY_HERE";
  const response = UrlFetchApp.fetch(url, { muteHttpExceptions: true });

  if (response.getResponseCode() !== 200) {
    Logger.log("API error: " + response.getContentText());
    return;
  }

  const json = JSON.parse(response.getContentText());
  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("API Data");

  // Clear old data, write headers + new data
  sheet.clearContents();
  const headers = Object.keys(json[0]);
  sheet.appendRow(headers);

  const rows = json.map(item => headers.map(h => item[h] || ""));
  sheet.getRange(2, 1, rows.length, headers.length).setValues(rows);
}
Enter fullscreen mode Exit fullscreen mode

Usage Tips

  • Error Logging: Every script writes to a "Logs" sheet automatically. Check it when debugging.
  • Rate Limits: Google limits MailApp.sendEmail() to 100/day on free accounts. The kit includes a queue system for high-volume sends.
  • Trigger Setup: Use ScriptApp.newTrigger("functionName").timeBased().everyHours(1).create() for scheduled runs.
  • Permissions: First run of each script will prompt for authorization. Review scopes carefully.

Best Practices

  1. Test in a copy — duplicate your sheet before running new scripts
  2. Use PropertiesService — store API keys in Script Properties, not inline
  3. Batch operations — use setValues() instead of looping setValue() for performance
  4. Error handling — wrap API calls in try/catch; log failures to the Logs sheet
  5. Quota awareness — monitor execution time (6 min limit) and daily quotas

This is 1 of 11 resources in the Spreadsheet Tools Pro toolkit. Get the complete [Google Apps Script Starter Kit] with all files, templates, and documentation for $49.

Get the Full Kit →

Or grab the entire Spreadsheet Tools Pro bundle (11 products) for $149 — save 30%.

Get the Complete Bundle →


Related Articles

Top comments (0)