# Extract Data from Gmail to Google Sheets: Pull order numbers, totals, dates and names out of your emails and add them to a Google Sheet you already use, on a schedule, without duplicates.

Source: https://zentor.ai/use-cases/extract-data-from-gmail-to-google-sheets

Extract data from Gmail to Google Sheets: Zentor reads matching emails, pulls the fields you name and appends clean rows to your sheet every day.

## Prompt

```text
Every morning, find new order confirmation emails in my Gmail from the last 24 hours. Pull the order number, store, date, item and total from each one and add a row to my Orders sheet. Skip anything that is already in the sheet.
```

Variations:

- **Invoices and receipts**: Find invoice and receipt emails from the last 7 days. Extract vendor, invoice number, date, amount and currency (open the PDF attachment if the amount is not in the body) and append one row per invoice to my Expenses sheet.
- **Leads from a web form**: Every hour, read new emails from my website contact form. Extract name, email, company, budget and message, and add each lead as a row in my Leads sheet. Mark the email with the label Logged.
- **One-off backfill**: Go through every email labeled Shipping from this year and build a sheet with carrier, tracking number, ship date and order number. Create the sheet for me.

## How it works

1. **Say which emails and which fields**: Describe the emails in plain English (sender, subject, label) and list the columns you want. Pick your existing sheet in the Google picker, or let Zentor create one.
2. **Zentor reads each email and fills the row**: It searches Gmail, reads the body and attachments, and pulls the values even when every sender formats them differently.
3. **It runs on a schedule and skips duplicates**: A daily or hourly run appends only new rows, using the order or invoice number as the key, and tells you what it added.

## What you can pull into Sheets

- Order confirmations: Order number, store, items, total.
- Invoices and receipts: Vendor, amount, date, currency.
- Contact form leads: Name, email, company, message.
- Shipping notices: Carrier, tracking number, ETA.
- Booking confirmations: Dates, guests, confirmation code.
- Job applications: Candidate, role, source, date.

## Comparison

| Feature | Apps Script | Export add-on | Zentor |
|---|---|---|---|
| Setup | Write and maintain code | Install and map fields | Describe the emails and columns in plain English |
| Values inside the body | Regex per sender, breaks on layout changes | Mostly sender, subject, date, body text | Reads the email and pulls the named fields |
| PDF attachments | Extra code | Usually not parsed | Opens the attachment when the value lives there |
| Duplicates | You build the check | Depends on the tool | Checks the key column before appending |

## FAQ

### How do I extract data from Gmail to Google Sheets automatically?

Connect Google in Zentor, then describe which emails to read and which columns to fill. Zentor searches Gmail, pulls the values from each email and appends a row to your sheet. Ask it to run every morning or every hour and it keeps the sheet current.

### Can it write to a sheet I already have?

Yes. Pick the sheet in the Google file picker when Zentor asks, and it appends to your existing columns. Zentor only gets access to files you pick or files it creates for you, not your whole Drive.

### What if every sender formats the email differently?

That is the main reason to use an agent here. Zentor reads the email the way you would and finds the order number or total wherever it sits, instead of relying on one fixed pattern per sender.

### Will it add the same email twice?

No, if you name a key column such as order number or invoice number. Each run checks the sheet for that key before adding a row.

### Can it read data from PDF attachments?

Yes. If the amount or invoice number is only in the attached PDF, Zentor opens the attachment and pulls it from there.

### Does Zentor send or delete my emails while doing this?

Not unless you ask. For this job it only searches and reads. You can also ask it to apply a label such as Logged so you can see which emails were processed.
