Back to Blog
Tutorial

Auto-Generate Documents from Google Sheets

Treat a Google Sheet as a living source of truth and let GJSDocs turn each row into a personalised PDF, DOCX, or HTML document. The setup is one connection, one mapping, and you're done.

May 2026·6 min read

The mail-merge problem, finally solved

Google Sheets is the most common workspace database in the world. Pricing data lives there. Customer lists live there. Class rosters, event registrations, donor records, project trackers — Sheets is where teams keep the lists they actually use.

The problem is what happens when you need to turn a row into a document. The traditional answer was "mail merge in Word", which works for letters but breaks down the moment you need real PDFs, conditional sections, branded layouts, or attachments. Add-ons help, but most are limited to the Sheets sidebar and don't scale beyond simple letter-style outputs.

GJSDocs takes a different approach: keep the spreadsheet as your data source, build the template once in a real visual editor, and generate any document — PDF, DOCX, HTML, Markdown — from any row, any view, or any range, on demand or on a schedule.

What you'll need

  • A GJSDocs account (free trial — no credit card)
  • A Google account with access to the spreadsheet you want to use
  • A spreadsheet structured with one record per row and clear column headers
  • A GJSDocs template (build from scratch, start from a sample, or import an existing PDF and let GJSDocs convert it)

Step 1 — Connect Google Sheets

In GJSDocs, go to Workspace > Integrations and click Google Sheets > Connect. You'll be redirected to Google's OAuth consent screen — sign in with the account that owns (or has access to) the spreadsheet, and grant read access.

After authorisation, GJSDocs lists the spreadsheets the account can see. Pick the spreadsheet, then pick the worksheet tab inside it. The first row of the worksheet is treated as the column headers — make sure your headers are descriptive (e.g. "Client Name" rather than "Col B") because they show up directly in the variable mapping screen.

Step 2 — Map columns to template variables

Open the template that should consume the data. The variable panel on the left of the editor lists every variable defined in the template. For each variable, pick the matching column from your worksheet via the dropdown.

{recipient.name} ← column "Full Name"

{recipient.email} ← column "Email"

{order.id} ← column "Order ID"

{order.amount} ← column "Amount"

{order.date} ← column "Order Date"

Number columns can be auto-formatted as currency, percentage, or with thousand separators. Date columns can be formatted with locale-aware patterns (e.g. DD MMM YYYY) so the document never shows raw spreadsheet values like 45123.

Step 3 — Generate from a single row

In the Generate view, pick the template, pick Google Sheets as the data source, and select the row you want to turn into a document. Click Generate.

GJSDocs reads the row in real time, fills the template, renders the output, and gives you the download link. Output format defaults to PDF; switch to DOCX, HTML, or Markdown via the format selector if a downstream tool needs an editable file.

Step 4 — Bulk generate from a range or filtered view

The same flow scales to entire ranges. In bulk mode you can choose:

  • A specific A1 range (e.g. rows 2–250) — useful when you only want to process a section of the sheet
  • A filtered view by column value — only generate documents for "Status = Paid", or "Region = EU", or "Send = TRUE"
  • The whole worksheet — useful for monthly statements or annual reports

GJSDocs runs the generations in parallel and produces either individual files (downloadable as a ZIP) or a single combined PDF if you want a multi-record statement. Per-record output filenames can include variable values, so you get invoice_{order.id}.pdf instead of invoice_1.pdf.

Automating the trigger

Manual generation is the starting point. To remove the click entirely, you have three options:

  • Google Apps Script + GJSDocs API. An onEdit trigger in your sheet calls GJSDocs when a row is marked "Ready" and writes the resulting PDF URL back to the row.
  • Zapier. "New row in Google Sheets" → "Generate document in GJSDocs" → "Send via Gmail / Slack / Drive". No code, full pipeline.
  • Scheduled jobs in GJSDocs. Run a batch every Monday at 9 a.m. against a filtered range — perfect for weekly status reports or recurring billing.

Use cases that work especially well

  • Mail-merge style letters — donation acknowledgments, account statements, renewal notices
  • Invoice generation — one row per invoice, GJSDocs produces and emails the PDF on a schedule
  • Certificates — course completions, attendance, awards, compliance records
  • Quotes and proposals — pricing data lives in Sheets, branded PDFs come out the other end
  • HR letters — offer letters, contracts, performance reviews, all from a single staff sheet
  • Reports — KPI snapshots and weekly summaries pulled from a metrics sheet

Pre-flight checklist

  • Confirm one record per row. If your sheet uses merged cells or multi-row records, flatten it before connecting — GJSDocs reads each row independently.
  • Use stable column headers. The mapping is by header name; renaming a header in Sheets requires re-mapping in GJSDocs.
  • Format dates and numbers in the template, not in Sheets. That way the source data stays clean and the output is consistent across views.
  • Test with a row that has a missing field. Generators should not crash on blanks — your template should handle them gracefully (use conditional sections for optional content).
  • Check rate limits. Google Sheets API has per-minute quotas. For very large bulk runs (10,000+ rows), batch-generate in smaller chunks or schedule overnight.

Turn a spreadsheet into a document pipeline

Connect Google Sheets, map a few columns, and start generating PDFs from rows. Free trial — no credit card.

Start free