Kavian Braanaas

Content Writer

Reading time: 5 min.
January 10, 2025

How to Extract Data From Emails and Export it to Google Sheets

In this post, we’ll show you how to set up an automated, production-ready workflow to extract data from email attachments using Cradl AI, Google Sheets, and Zapier. We’ll use invoices as our document type, but Cradl AI’s flexible and accurate AI models can handle just about any document layout.‍‍

Create a Cradl AI data extraction model

Before we begin, make sure you’ve created a Cradl AI account.

Once you’re logged into Cradl AI, create your first AI model with just a few clicks. In this example, I’ll clone the Invoice model to keep things simple, but creating a model from scratch works just as well for other documents.

Customise the model to suit your needs by adding or removing fields based on the data you want to extract.

Screenshot of the model configuration user interface inside Cradl AI

Test your data extraction model on a document

To try out your new AI model, simply upload one of your invoices, and the AI model will automatically extract data from it.

Screenshot of the run model user interface inside Cradl AI

Connect your data extraction model to a mailbox

Cradl AI's «email trigger» simplifies connecting Cradl AI to any email inbox. Once enabled, it generates a unique email address. Any email sent or forwarded to this address with an attached document is automatically processed by your Cradl AI model.

Using Cradl AI's Email trigger

  1. Select «Email» from the list of available triggers in Cradl AI.
  2. Click «Save» to generate a dedicated Cradl AI email address.
  3. Test the integration by sending an email with a document attached to the newly generated address. The document will be automatically processed, and you can view the extracted data inside the Validator in Cradl AI.
Screenshot of the the email trigger user interface inside Cradl AI

Create a Sheet in Google Drive to store data

Now that your AI model is working, we'll connect it with a Google Sheet.

Head over to your Google Drive and create a blank spreadsheet. Add headers that correspond with the fields you want to extract from your documents. In Google Sheets you add headers by simply typing values into the topmost cells:

Screenshot of a Google Sheets sheet with headers configured

Connect Cradl AI to Google Sheets via Zapier

Because Cradl AI currently does not have a native Google Sheets integration, we'll be using Zapier to integrate them for us.

  1. Head over to Zapier and create a free account.
  2. Use Cradl AI’s pre-built integration with Google Sheets and follow the step-by-step instructions in Zapier.
  3. Map Cradl AI’s extracted fields to your spreadsheet headers.
Screenshot of the Zapier user interface with the Google sheets connector configuration pane

Mapping extracted data from Cradl AI to dynamic Zapier values

When you're mapping Cradl AI's extracted data fields to your spreadsheet's headers, you'll notice that you can choose from way more fields than the handful you defined in your spreadsheet's headers.

99% of the time you are looking for those values that are prefixed with «Validated Predictions» and suffixed with «Value» , such as «Validate Predictions Purchase Date Value», «Validate Predictions Total Amount Value», and so on.

Screenshot of the Zapier user interface with the Google sheets connector step 2 configuration pane

Running the entire automated workflow

Once your Zap is activated, the automation is ready to run:

  1. Forward an email with an invoice attachment to your Cradl AI email address.
  2. Cradl AI will automatically process the document and display the extracted data in the Validator interface.
  3. Review the extracted data for accuracy, correct any flagged errors, and click Validate to confirm.


Clicking Validate triggers the Zap, sending the data directly to your Google Sheet. Within seconds, your spreadsheet will update with the extracted values.

Summary

With Cradl AI and Zapier, automating data extraction from email attachments is simple. Clone Cradl AI’s invoice model, customise the fields, and set up an email trigger to process incoming attachments automatically. Create a Google Sheet with the necessary headers, then use Zapier to integrate Cradl AI with Google Sheets. Each time an email with an invoice is sent to your Cradl AI address, the data is extracted, validated, and transferred to your spreadsheet.

Get started for free

We’ll help get you started with your document automation journey.

Schedule a free demo with our team today!