December 20, 2024
Reading time: 5 min.

Extract Data from Email Attachments to Google Sheets

Kavian Braanaas

Content Writer

In this guide, 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 model for your documents

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


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 Cradl AI 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.

To set this up:

  • Select Email from the list of available triggers in Cradl AI.
  • Click Save to generate a dedicated Cradl AI email address.
  • Test the integration by sending an email with a document attached to the 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

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.

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


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 automated workflow

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

  • Forward an email with an invoice attachment to your Cradl AI email address.
  • Cradl AI will automatically process the document and display the extracted data in the Validator interface.
  • 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!