Create searchable case log from incoming support emails
Every new support email gets its own row in a Google Sheet, with the sender, subject, a short summary and any order or ticket number it mentions, so the team can search and triage cases in one place.
Install it
Set up this Zap for me, read how here: https://zapier.sh/zapier/awesome-zaps/create-searchable-case-log-from-incoming-support-emails/
Paste into Claude, ChatGPT, Cursor or any agent.
- Author
- Zapier
- Source
- zapier/awesome-zaps, folder zaps/create-searchable-case-log-from-incoming-support-emails
Set it up with the CLI
- Add it. Copies the folder into
zaps/create-searchable-case-log-from-incoming-support-emails/. Outside a project, it makes one first.npx zap-pack add awesome-zaps/create-searchable-case-log-from-incoming-support-emails - Fill in the values in
config.ts, and in any other file the list marks. Replace each one as its comment and SKILL.md say. - Deploy it. Asks for any value still left, signs you in to Zapier if you aren't, then publishes it to your account.
npx zap-pack deploy create-searchable-case-log-from-incoming-support-emails - Check it. Its recent runs, with status and errors.
npx zap-pack logs create-searchable-case-log-from-incoming-support-emails
zaps/create-searchable-case-log-from-incoming-support-emails/
- README.mdWhat it does, for people
- SKILL.mdHow an agent sets it up: what to ask you, and how to test it
- config.tsIts settings 1 to fill in
- connections/gmail.tsThe
gmailaccount it uses - connections/google-sheets.tsThe
google-sheetsaccount it uses - triggers/message.tsWhat starts it:
gmailmessage - workflow.tsThe code; each
ctx.stepis a step in the Zap
Agents: add --yes to any command so it never prompts. When it needs an answer only the user can give, it stops and names the flag that supplies it.
SKILL.md
View MarkdownWhat it does
- Trigger: a new email lands in the monitored Gmail label or mailbox (
gmail,message). - Code: pulls a case reference: the first run of
MIN_REFERENCE_DIGITSor more digits in the subject, or in the body if the subject has none. Short numbers such as a 4-digit account number are ignored. - Google Sheets looks up the message ID in the log. If a row already has it, the run stops and writes nothing.
- Google Sheets appends a row: message ID, thread ID, sender name, sender email, subject, snippet (summary), reference, whether it has attachments, received time and logged time.
The Zap only appends rows. It never changes or deletes an existing one.
Ask the user
Each REPLACE_… value is set per person. Resolve names to IDs with the user's own connections; don't ask them to paste an ID you can look up.
| Setting | What goes there |
|---|---|
REPLACE_SPREADSHEET_ID |
The spreadsheet that holds the case log: ask which sheet it is, then look up its ID with the user's Google Sheets connection |
Also ask:
- Which Gmail account and which label or mailbox is the support inbox? Set the trigger's
label_idsto it. A dedicated label (for example a filter that labels mail sent to support@) is better thanINBOX, which logs every email. - Which tab of the sheet is the case log, and which columns should each field go to? Offer to create a new sheet with the default headers.
- What do their case references look like? If they are shorter than 5 digits or contain letters (
CASE-1234), changeMIN_REFERENCE_DIGITSor tell them the extraction only finds plain digit runs.
Defaults to review with them: WORKSHEET_ID ("0" is the first tab), the column keys MESSAGE_ID_COLUMN to LOGGED_AT_COLUMN (COL$A to COL$J, in this order: Message ID, Thread ID, Sender Name, Sender Email, Subject, Summary, Reference, Has Attachments, Received At, Logged At; if the user has no log yet, create a sheet with those headers), and MIN_REFERENCE_DIGITS (5).
Build it
If you can run shell commands, set it up with zap-pack: run npx zap-pack add awesome-zaps/create-searchable-case-log-from-incoming-support-emails, replace each REPLACE_… value as this file says, then run npx zap-pack deploy create-searchable-case-log-from-incoming-support-emails, which signs the user in to Zapier when it gets there. Otherwise build with Zapier MCP, as the steps below say. No Zapier MCP tools? Read https://docs.zapier.com/mcp/get-started/quickstart.md and follow the page for the app you are running in to get the user connected, then continue with this build.
- Accounts: bind
google-sheetsto the user's Google Sheets connection for the account that owns the case log. The trigger'sgmailalias is the support inbox: bind it to the user's Gmail connection for that inbox. - Source: publish
workflow.tsandconfig.ts, with eachREPLACE_…replaced by the user's answer.triggers/message.tsandconnections/are settings, not code: set the workflow's trigger and connection bindings from them. The trigger file names the app by its slug; for the trigger'sselected_api, callsearch_triggerswith that slug, find the row whosekeyis the trigger'sevent, and use<app_key>@<app_version>from it. Set the trigger'slabel_idsparam to the monitored label or mailbox. Get the choices withget_trigger_field_choicesonlabel_ids; system mailboxes use their names (INBOX), and user labels look likeLabel_123…. Never leave it empty: an empty value fires on every email, drafts included. - Build guide: load Zapier's build guide with
get_zapier_skill("zapier:build-workflows")and follow it to create, test and publish the workflow. - Fields: inspect each action's fields with the user's connections and sample the Gmail trigger before the first test run, and fix any key in
workflow.tsthat doesn't match.
Test it
Run it once as a draft test (run_workflow_draft) with this sample input, which is made-up data and not a real email:
{
"id": "1a189f4f3104ae58",
"message_id": "1a189f4f3104ae58",
"thread_id": "1a189f4f3104ae58",
"from": {
"name": "\"[install-test] Test Customer\"",
"email": "support-inbox@example.com"
},
"subject": "[install-test] Support: refund for order 48213907 not received",
"body_plain": "Hi support team,\n\nI was promised a refund for my order last week but it hasn't arrived. My account number is 7765. The original invoice was 55512340099.\n\nThanks,\nTest Customer",
"date": "Thu, 29 Oct 2026 16:18:13 -0700",
"attachment_count": 0,
"raw": {
"snippet": "Hi support team, I was promised a refund for my order last week but it hasn't arrived. My account number is 7765. The original invoice was 55512340099. Thanks, Test Customer"
}
}
Check that one new row appears in the case log, with Reference 48213907 (from the subject, not the body's 55512340099), Sender Name without quotes, and ' decoded in the summary. Then run it again with the same input: the run should return skipped: true, reason: "already-logged" and no second row should appear. If run-status tools aren't available, check the case log in Google Sheets directly. Ask the user to delete the test row; the agent doesn't delete test data.
Then publish and confirm the trigger is active.
Notes
- Duplicates are matched on Gmail's message ID only. Replies in the same thread are new messages and get their own rows; the shared thread ID links them.
- The reference is taken from the full plain-text body when Gmail provides it, otherwise from the snippet. The summary column is Gmail's snippet (about 200 characters).
- Google Sheets may show the timestamps in the sheet's own format and time zone.
- To alert someone when no reference is found, add a Slack message or email step after the append that runs when
referenceis empty. - To update an existing case instead of appending, look up the extracted reference in the Reference column first and update that row (for example, to add a reply count).
- Never commit a real spreadsheet ID.