← Back to library

Normalize lookup keys before an agent searches records

u/pottercron, a product owner using agents for user management, found lookups failing because customer emails were stored exactly as typed, with mixed case, and the agent tool used case-sensitive matching. Workarounds hit tool limits. We turn that into a rule: normalize keys when data is written, before any agent reads it.

  • OutcomeStore a cleaned copy of emails and IDs so agent lookups do not miss customers because of case or spacing differences.
  • SetupMinutes
  • LevelStarter
  • Creditu/pottercron on r/zapier
View original
Works with
ZapierMaken8n

Published Oct 23, 2026Updated Oct 23, 2026AI dry run on sample input: passed Oct 23, 2026Source verified Oct 23, 2026

When should you use it?

  • Your agent finds customer records by email address
  • Records come from payment or form tools
  • Lookups miss existing users

Not for: Systems already enforcing normalized keys

What do you need, and what do you get?

You need

  • Customer table
  • Intake automation

You get

  • Normalized key column
  • Lookup tests

How does it work, step by step?

  1. Add a key columnStore lowercase, trimmed email at write time.
  2. BackfillNormalize existing rows.
  3. Lookup on the keyPoint agent tools at the normalized column.
  4. Normalize inputClean the email the agent searches with the same way.
  5. TestTry mixed-case and spaced inputs.

The prompt

Our own prompt, inspired by u/pottercron on r/zapier and written to work in Zapier, Make and n8n. Values in lime are placeholders.

Fill in the blanks (optional; the copied prompt uses your values)

Prompt1 variable
Given this list of customer records {records}, normalize email (lowercase, trimmed) and phone (digits only with country code).
List records that collide after normalization as likely duplicates. Do not merge; report only.

Inspired by u/pottercron on r/zapier: Issues With Zapier Agents. The prompt above is written by playbooks.bot in our own words; nothing from the original is quoted.

What can go wrong?

  • Some agent tools cannot see new columns until refreshed; test after changes.
  • Duplicates appear after normalization; merge them.

Our take

The frustration is with a specific tool, but the lesson travels: agents are only as good as the keys they search on. Normalizing at write time removes the problem for every tool downstream. Add a canonical key column, backfill it, and make lookups use that key only. Normalize input on every write path, including imports and admin edits. Test with deliberately weird casing and whitespace. Document the rule so future agents and humans do not invent new formats. Prefer email lowercasing and trimmed strings; for phones, store E.164. When a tool cannot normalize, refuse to use it for lookups until it can. Monitor failed lookup rates after the change. Keep a one-off repair script for historical rows. Never teach the agent to guess among near-matches for account changes without a human confirm. Audit admin emails that grant access after the migration. Add a unique constraint on the canonical key so duplicates cannot creep back in.

Where the time goes back: Agents stop creating duplicates or missing customers because of formatting.

FAQ

Why not rely on instructions?
Tool settings often override text instructions.
Does it apply beyond email?
Yes, for phone numbers and IDs too.

Source and credit

Inspired by u/pottercron on r/zapier. We describe the idea in our own words, link to the original, and wrote the prompt ourselves; nothing is quoted.

Inspired by
Issues With Zapier Agents
Creator
u/pottercron on r/zapier
Published on
Reddit
Original date
Mar 6, 2026
License
Not openly licensed (the poster keeps all rights), so we quote nothing and link to the original
Originally for
Zapier
AI dry run
Oct 23, 2026: passed. Dry-run tested by our AI test agent on sample input. PASS: Gates held on desk check; no live sends or purchases.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails.
Verified
Oct 23, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.

Are you the creator? Claim or correct this page.

More in Operations & Admin

All 203 Operations & Admin playbooks →

Related playbooks

Operations & AdminWorkflow✓ AI dry run

Catch the emails your AI inbox assistant never processed

Run your AI email triage workflow as usual, label every message it handles, and add a second, independent workflow that once a day searches the inbox for recent mail without that label and sends you the list, alongside retries on the model steps and a production-status sign-in so the trigger does not silently expire.

Credit: Huzaifa_Aamish

Under an hour
Operations & AdminWorkflow✓ AI dry run

Confirm padel court times from a chat channel

Customers book, change or cancel courts by chatting, while a deterministic workflow assigns courts and prevents clashes.

Credit: u/PriceNew5674 on r/n8n

An afternoon+
Operations & AdminWorkflow✓ AI dry run

Confirm tables on WhatsApp against a live book

Guests book a table by chatting on WhatsApp, staff see bookings on a table plan, and reminders go out automatically.

Credit: u/begylewis on r/micro_saas

An afternoon+
Operations & AdminWorkflow✓ AI dry run

Merge overnight mail, meetings and tasks by 7am

One short morning brief per person that points to prep, replies and the day's important tasks, instead of starting in five tools.

Credit: u/Cnye36 on r/AI_Agents

Under an hour
Operations & AdminWorkflow✓ AI dry run

Migrate a blog off a CMS to local Markdown files

Move hundreds of posts from a heavy CMS to local Markdown in one afternoon by having a terminal agent handle the repetitive extraction and conversion.

Credit: Pauline P. Narvas

An afternoon+