Save trademark search report attachments to central folder
Each trademark search report attachment that arrives by email is saved to one central Drive folder, named with its date and subject, so legal can review it in one place.
Install it
Set up this Zap for me, read how here: https://zapier.sh/zapier/awesome-zaps/save-trademark-search-report-attachments-to-central-folder/
Paste into Claude, ChatGPT, Cursor or any agent.
- Category
- Legal · Intellectual property management
- Author
- Zapier
- Source
- zapier/awesome-zaps, folder zaps/save-trademark-search-report-attachments-to-central-folder
Set it up with the CLI
- Add it. Copies the folder into
zaps/save-trademark-search-report-attachments-to-central-folder/. Outside a project, it makes one first.npx zap-pack add awesome-zaps/save-trademark-search-report-attachments-to-central-folder - 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 save-trademark-search-report-attachments-to-central-folder - Check it. Its recent runs, with status and errors.
npx zap-pack logs save-trademark-search-report-attachments-to-central-folder
zaps/save-trademark-search-report-attachments-to-central-folder/
- 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-drive.tsThe
google-driveaccount it uses - triggers/search.tsWhat starts it:
gmailsearch - 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 Gmail email matching the search (
gmail,search) arrives. The search issubject:(trademark search report) has:attachment, and the trigger returns each message with its attachments. - The run stops if the email has no attachments.
- The email's date becomes
YYYY-MM-DD, and the subject is cleaned of characters Drive does not allow in file names. - Google Drive uploads each attachment to the central folder as
<date> <subject> - <original file name>. Uploads run in parallel, one step per attachment. A failed upload is recorded in the result and does not stop the others.
The Zap only uploads. It never edits, moves or deletes files already in the folder.
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 |
|---|---|
DRIVE_FOLDER_ID |
The central Drive folder, which must already exist: look it up from the folder the user names, with their Google Drive connection. It is the long ID at the end of the folder's URL |
Also review the defaults with them: SEARCH_QUERY is the Gmail search that finds the reports (by default, a subject containing "trademark search report" with an attachment). It is copied into the trigger's search keywords, so keep the two in sync.
Also ask which Google account owns the central folder. Its Google Drive connection needs edit access to that folder.
Build it
If you can run shell commands, set it up with zap-pack: run npx zap-pack add awesome-zaps/save-trademark-search-report-attachments-to-central-folder, replace each REPLACE_… value as this file says, then run npx zap-pack deploy save-trademark-search-report-attachments-to-central-folder, 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-drive(the account that owns the central folder, with edit access to it) andgmail(the mailbox that receives the reports, for the trigger) to the user's connections. - Source: publish
workflow.tsandconfig.ts, with eachREPLACE_…replaced by the user's answer.triggers/search.tsandconnections/are settings, not code: set the workflow's trigger and connection bindings from them, and set the trigger's search keywords to the value ofSEARCH_QUERY. 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. - 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 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 with this sample input. Use a folder the user can throw away.
{
"message_id": "EXAMPLE_MESSAGE_ID",
"subject": "Trademark search report [test]",
"date": "Thu, 29 Oct 2026 10:15:00 +0000",
"attachmentsArray": [
{
"attachment": "https://example.com/files/report.pdf",
"truncatedFileName": "report.pdf",
"mime_type": "application/pdf"
}
]
}
Check that the run returns uploaded: 1 and failed: 0, and that the folder has one new file named 2026-10-29 Trademark search report [test] - report.pdf. Then run it once more with an input that has no attachments: it should return skipped: true and upload nothing. If run-status tools aren't available, check the result in Google Drive directly. The user deletes the test file afterwards, not the agent. Then publish, confirm the trigger is active, and tell the user that nothing runs until a matching email arrives.
Notes
- The Gmail trigger reads all folders, including sent mail, unless the search says otherwise. Add
in:inboxto the search to limit it. - Drive keeps both copies if a file with the same name is already in the folder.
- To extend it: skip mail already filed by storing each message ID in a sheet, create the folder if it is missing, sort uploads into sender-domain subfolders, or label each matched email so reviewers can find it.
- Never commit a real folder ID or email address to a shared copy of
workflow.ts.