An elegant, zero-overhead Google Apps Script automation that turns raw Google Form submissions into fully written, polished newsletter drafts using Gemini AI, and logs them directly inside the same response spreadsheet.
This repository is designed specifically for vibecoders and non-technical people who want a premium, friction-free "plug-and-play" pipeline. It features a 1-click automatic setup that builds your form, links your sheets, and installs triggers in under 3 minutes!
[ User Submits Form ]
(Raw Story, Details, Links,
Visual Assets folder link)
│
▼
[ Google Sheet Response ]
│
▼
[ Apps Script Trigger: onFormSubmit ]
├── 1. Q&A Packaging (all fields → structured block)
├── 2. Gemini AI → Polished Article Body
├── 3. Gemini AI → Short Engaging Title (≤ 10 words)
└── 4. Creates Two Google Docs in Drive
├── Q&A Doc (raw source)
└── Draft Doc (polished article
+ 📸 Visual Assets link appended)
│
▼
[ Logs Draft Title & Link to "Drafts Log" Tab ]
- 1-Click Automated Setup: Run a single helper function and Google will build the 10-question form, connect it to your sheet, create logging tabs, and register triggers programmatically. No manual clicking required!
- Only One Spreadsheet Needed: No secondary tracker spreadsheets to configure. Everything is saved and logged in the same response sheet.
- Adaptive Gemini Prompt: The AI reads the raw submission content, automatically analyzes the style (recognizing if it highlights a person, recaps a past event, shares a new launch, or announces a partnership), and writes the newsletter draft in the perfect style.
- AI-Generated Titles: Gemini writes a short, punchy title (≤ 10 words) from the full submission context — no more pulling a raw form field as the headline. The same AI title is used for the Q&A doc, the draft doc filename, and the Drafts Log entry.
- Visual Assets Link in the Draft: The contributor's submitted visual assets link (Drive, Dropbox, etc.) is appended directly to the bottom of the draft Google Doc, so the newsletter editor can access files without ever opening the original form response.
- Create a brand new Google Sheet.
- Go to the top menu and select Extensions ➔ Apps Script.
- Click into the default
Code.gsfile, select all, and replace it with the contents of bundle.gs. - Click Save (💾).
- In the function dropdown at the top, select
setupPipelineand click Run. - Authorize Permissions: Follow the prompt (click Advanced ➔ Go to Untitled Project (unsafe)).
- Once it finishes, open the Execution Log — it will print the links to edit and share your new Google Form!
- Get a free key from Google AI Studio.
- In Apps Script, click Project Settings (gear icon) ➔ Script Properties ➔ Add script property.
- Set the property name to
GEMINI_API_KEYand paste your key as the value. Save.
Optional: By default, all draft Docs are saved in the same Drive folder as your spreadsheet. To save them somewhere else, edit the
DRAFT_FOLDER_IDvalue near the top of the bundle with your target folder's ID (found in its URL:drive.google.com/drive/folders/YOUR_ID_HERE).
- Open the shareable Google Form link you copied in Step 2.
- Submit a test response. Include a Google Drive or Dropbox link in the Visual Assets field.
- Back in the Apps Script editor, select
testWithLastResponsein the function dropdown and click Run. - The Drafts Log sheet will populate with the date, AI-generated title, and a direct link to the polished draft Doc!
- Open the draft Doc — the AI-written article is at the top, and the 📸 Visual Assets link is clearly labeled at the bottom for your editor.
Prefer to keep the code organized across separate files? Create each of the following in the Apps Script editor (click + next to Files) and paste the matching file from this repo:
Then follow Steps 2 and 3 above — setupPipeline and the API key setup are the same.
If you prefer to build and deploy locally, see FORM_IDS.md for instructions on finding your Script ID.
- Copy the clasp template:
cp google-apps-script/.clasp.example.json google-apps-script/.clasp.json
- Open
google-apps-script/.clasp.jsonand fill in the Script ID of your response sheet's Apps Script project. - Install clasp, log in, and push:
npm install -g @google/clasp clasp login clasp push
Happy coding, and let the vibes flow! 🌊