MailSlurp logo

automations

Email Parser Google Sheets Integration

Turn inbound emails into traceable Google Sheets rows with typed fields, idempotent updates, and a practical review and retry workflow.

A MailSlurp email parser and Google Sheets integration turns inbound messages into structured rows for review, reporting, and day-to-day operations. MailSlurp offers a direct Google Sheets destination in beta for eligible plans; contact support if you want it enabled for your account. You can also connect transform events to your own Sheets writer when you need full control over validation, row matching, and retries.

The application-owned workflow in this guide does not blindly append every webhook. It validates the extracted record, finds the correct row, and keeps identifiers that lead back to the original email and transform result.

A practical sheet design

For an invoice review sheet, start with columns that separate extracted business data from workflow metadata:

Column Example Why keep it
invoice_number INV-2048 Business key used to find an existing row
supplier Northwind Parts Helps disambiguate invoice numbers across senders
total 1840.50 Numeric value for formulas and review
currency USD Prevents totals in different currencies being combined
received_at 2026-08-26T09:12:00Z Shows when MailSlurp received the source message
source_email_id MailSlurp email UUID Links the row to the original message
transform_result_id MailSlurp result UUID Links the row to the exact extraction result
sync_status ready, review, or failed Makes exceptions visible without changing business fields

Use a combined key such as supplier + invoice_number when the same invoice number could appear for more than one supplier. For another workflow, choose a stable domain key such as an order ID, application ID, or ticket reference.

From email to the correct row

  1. Receive the email in a dedicated MailSlurp inbox or connected Gmail or Outlook account.
  2. Match it to a transformer using stable facts such as the recipient, sender, or subject.
  3. Extract a typed result that mirrors the business columns in the sheet.
  4. Receive the NEW_AI_TRANSFORM_RESULT webhook and reject a repeated messageId that has already been handled.
  5. Fetch the full result with aiTransformResultId when needed, then validate required fields and formats.
  6. Find the row using the business key and update it, or create a row when no match exists.
  7. Save source_email_id, transform_result_id, the destination row ID, and the sync outcome for traceability.

This is an upsert: the same invoice updates the same row. A webhook retry should not add a second invoice to the sheet.

Map types deliberately

Google Sheets is flexible, which makes accidental type changes easy. Normalize the result before the write:

  • send numbers as numbers, not formatted currency strings;
  • convert dates to one agreed format and keep the source timezone when it matters;
  • restrict status fields to a small known set;
  • write arrays, such as invoice line items, to a separate tab when each item needs filtering or totals;
  • leave a genuinely absent value blank and set sync_status to review when the field is required for the next action.

Protect formula and header columns from being overwritten by the integration account. If someone renames or reorders a business column, fail visibly rather than shifting values into the wrong place.

Handle common failures

The webhook arrives twice

Check the MailSlurp webhook messageId before doing any work. If the first attempt completed, acknowledge the repeat without writing to Sheets again. If it stopped halfway through, use the stored transform result and destination row IDs to resume only the incomplete step.

The schema and sheet no longer agree

Version schema and column changes together. When validation fails or an expected header is missing, record the error and send the result to an exceptions tab or review queue. Do not squeeze a new field into a nearby column.

Google temporarily rejects the write

Treat rate limits and temporary service errors as retryable. Use bounded backoff, keep the transform result ID with the attempt, and avoid rerunning the AI extraction when only the Sheets write failed.

The extracted result is incomplete

Keep the row visible with sync_status set to review, the source email ID, and the transform result ID. A reviewer can check the original email, correct the business field, and retry the destination step without losing the audit trail.

Sheets, Drive, or a database?

Use Google Sheets when people need a shared queue or lightweight reporting surface. Use Google Drive for original PDFs and attachments. Many invoice workflows use both: Drive stores the document and Sheets displays its extracted fields and review status.

For balances, payments, inventory, or other state that needs transactional guarantees, write the canonical record to your application database or queue first. Sync the fields people need to Sheets as a convenient view.

Build the complete workflow