Parseur.com

Powerful email parser software

  • Features
  • Integrations
  • Use Cases
  • Pricing
  • Log in

How to extract tables from emails

October 15, 2018 by Sylvain Josserand Leave a Comment

In this article we’ll see how to setup Parseur to extract tables from emails and parse result into structured data.

Extracting tables from emails is very useful, for example, when you want to process shopping orders coming in your mailbox. There is typically varying number of items in each email and you don’t want to create a template for each different number of ordered items. For each ordered item, you want to extract several informations such as item name, quantity and price.

This article will assume you already have a Parseur account. If not, you can sign up for free here. Also, we will assume you already know how to create templates to parse simple emails with Parseur. If not, we recommend you to first read this Getting Started with Parseur guide.

Extracting a table from your emails, automatically

For the purpose of this demonstration, let’s assume we want to extract details about book orders on Amazon. Whenever we order on Amazon, Amazon sends a confirmation email containing order detail. An Amazon confirmation email looks like this:

Example of an Amazon confirmation email containing the list of books ordered

We want to create a template that can extract order details, including for each item the book title and the book price. We want to create a single template that will extract all data, irrespective of the number of books ordered.

Here is what you get after processing this email in Parseur:

FieldValue
Reference123-4567890-1234567
DateSunday, October 7
Customer AddressJane Doe
FAIRVIEW HEIGHTS
VAN HOUTEN HILL
LONDON, ZZ9 ABC
United Kingdom
Items[0].TitleFear and Loathing in Las Vegas
Items[0].Price£12.99
Items[1].TitleThe Tempest
Items[1].Price£9.99
Items[2].TitleThe Hitchhiker’s Guide to the Galaxy
Items[2].Price£14.99
Total£37.97

And here is the same result, viewed in JSON format:

Data extracted by Parseur, in JSON

How to extract tables from emails with Parseur?

Staying true with our philosophy, capturing a table in Parseur is as simple as point and click.

Step 1: create a Table Field

  • In the template editor, select the whole table you want to capture.
  • Click New Table Field to create a new field for that selection.

The table option panel opens on the right-hand side and the table gets highlighted in green.

Note: for best results, make sure the document you use for the template contains at least 2 rows (i.e. in our example, 2 books).

Selection the whole table section and create a new table field

Step 2: set table name and options

Use the Table option panel on the right-hand side to customize your field:

  • Name: Enter table field name
  • Output format: leave as is (“Table”)
  • Input format:In most cases, leave as is (“Vertical HTML Table”). Parseur will assume your table rows are laid out vertically, top to bottom.
    • If your table rows are laid out horizontally from left to right, select “Horizontal Table”
    • If your table is Text only, choose “Vertical Text Table” (or “Horizontal Text Table” respectively).
  • Table Header: If the first row of your table contains the column names and Parseur was able to correctly identify columns in the result preview, tick the box “Table headers included in selection”. Otherwise go to Step 3 below to teach Parseur how to identify your columns.

Step 3: create Table Columns

At the bottom of you document, Parseur shows you a live preview of the table parsing. We are going to create column fields to tell Parseur which information we want to extract. And then, we’re going to points those columns across multiple rows until the preview result is what we want.

To do this:

  1. Select a piece of text you want to extract on the first row of the table
  2. Click New Table Column
  3. Enter a name for that new column and hit Enter (or click the tick button)

Repeat steps 1. to 3. for each column field you want to extract.

Now we need to teach Parseur how to split rows:

  • Select similar fields on the following rows and assign it to the existing field.
  • Do this until the result preview suits what you need.

When the table preview at the bottom of the document shows the desired result you are done!

Create column fields and teach Parseur where they are in the table until you get the desired result.

Advanced usage: Table parsing setting using Regular Expressions. Parseur can reliably extract table data from documents just by pointing and clicking the fields as described here. In case you need to do some advanced table parsing, you can set your own table tow separators and table cell separators as Regexps in the Advanced options section.

Step 4: Save your Changes

Click the Save Field button when done editing the table field.

Then, continue editing the template adding new fields and finally click Create Template when completed.

Exporting your table data

You have several strategies available when it comes to exporting your table data. This section lists the different strategies depending on the type of export.

Download and Google Sheet

There are 2 options to export your table data:

  • The default export keeps the “1 document per sheet row” convention: table field rows will be added as columns.
  • The table export uses the “1 table field item per sheet row” convention: each table field item will be on its own sheet row and other fields extracted from the document will be repeated across rows.
Choose between default export and table export depending how how you want your data to be formatted

Zapier

There are 4 ways to send table data to Zapier:

  1. Send each document as a whole with all tables and lists flattened. Flattened means each document looks like the table mode result on the right of your document. It also means that the number of columns varies with the number of rows in the largest table (this is the default mode).

2. Send the table directly through Zapier, each row in this table will turn into a row (or item) in the target application (for example, a row in Google Spreadsheet). Non-table fields in the document are repeated for each row. Sub-tables, if any, are flattened.

These are the most commonly used options and should provide the best compatibility with other apps. If you have more advanced needs, read on!

3. Send the document with nested tables. This is similar to the JSON mode result on the right of your document. The number of columns does not vary with the number of rows. But the receiving app must be capable of handling item lists. At the time of this writing, very few apps handle list items, Freshbooks being an important exception.

First, show less common options

4. Send the table directly through Zapier. Each row in this table will turn into a row (or item) in the target application (for example, a row in Google Spreadsheet). Non-table fields in the document are repeated for each row. This is similar to option 2, but the nested tables and lists if any, are not flattened.

As you can see, options 1 and 2 flatten the tables and are the safest, most compatible mode. If you encounter issues with on options 1 and 2, give options 3 and 4 a try, but keep an eye on app compatibility.

Webhooks

There are 3 options to export your table fields via webhooks:

  • Document processed: this is the default option. JSON payload is a deep key/value object with table fields values sent as an array (equivalent to the JSON screen capture at the beginning of this article)
  • Document processed (flattened): JSON payload is a flat key/value object with keys named as in the default table export (e.g. “Items[1].Title”)
  • Table item processed: JSON payload is an array of table item objects where other fields are repeated across table items (similar to the table export for Google Sheets).

Filed Under: Blog, How to, Tutorial Tagged With: Delivery Orders, extract tables, Invoice Processing, Shopping Orders, tables, Zapier

Parseur is the most powerful and easy-to-use mail parser.
Save hours of manual work and improve data entry speed and quality.

Try Parseur Now for free!

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Create your Parseur account now!

Parseur is the most powerful and easy-to-use email parser on the market.
Save hours of manual work and improve data entry speed and quality.

Sign up for Free

Get started on our free forever plan. No credit card required, no strings attached!

Search

Latest Posts

  • How to send data extracted from email to Microsoft Flow?
  • Alternative to Mailparser.io: comparing Parseur vs Mailparser
  • Alternative to Zapier Email Parser: comparing Parseur vs Zapier Parser
  • How to extract tables from emails
  • How to automatically forward emails, the definitive 2019 guide
  • How to create your Parseur account and mailbox
  • How does Parseur work?
  • How to send parsed email data to webhooks
  • How to extract text from email attachments and documents
  • How to prevent some documents from being parsed
  • Extract data from Airbnb emails and automate your booking workflow
  • How to combine CSV files, Excel and spreadsheets together automatically

About

  • Home
  • Features
  • Integrations
  • Use cases
  • Pricing
  • Customer Reviews
  • Blog

Legal

  • Terms and Conditions
  • Privacy Policy
  • Cookies Policy
  • GDPR Compliance

Latest news

  • How to send data extracted from email to Microsoft Flow?
  • Alternative to Mailparser.io: comparing Parseur vs Mailparser
  • Alternative to Zapier Email Parser: comparing Parseur vs Zapier Parser
  • How to extract tables from emails
  • How to automatically forward emails, the definitive 2019 guide
  • How to create your Parseur account and mailbox
  • How does Parseur work?

Get in touch

  • Email
  • Facebook
  • LinkedIn
  • RSS
  • Twitter
  • YouTube

OWNER

Parseur B.V.
Konnetlaantje 4,
1435HW Rijsenhout
The Netherlands
BTW NL858285125B01

Copyright © 2016-2019 · Parseur.com · All rights reserved

We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it (read more).Ok