How to Automatically Extract Data from Monthly Reports and Send via Email using PDF.co and Zapier
Send Parsed Data from Monthly Reports via Email
In this tutorial, we will show you can extract data from a PDF using PDF.co Document Parser, send the extracted text as the body of the email using Gmail, and automate this process using Zapier.
We will use this sample Monthly Report and extract the highlighted value in the table.
Contents
Step 1: Set up Your Source File Storage
We assume that you already set up the initial step for your source file storage.
Step 2: Select the App and the Action Event
In our action step, let’s choose PDF.co as the App and the Document Parser as the Action Event.
Step 3: Set up the Action Event
Let’s set up the Document Parser Action Event.
- In the Input field, select or choose the source file URL.
- In the Template Id field, enter your Template Id. You can find the Id number on the Document Parser Template’s page.
To learn how we created the template to extract the value in the table for this file, jump to the How to Create the Document Parser Template section.
Step 4: Send the Configuration for Test & Review
Let’s send our Document Parser configuration to PDF.co to Test & Review.
Step 5: PDF.co Parsed Output
Great! Our test was successful. PDF.co returned our parsed value.
Step 6: Set up a New Zap
Now let’s move on to our next Zap step. Let’s select Gmail as the App and Send Email as the Action Event.
Step 7: Set up the Gmail Email
Let’s set up our Gmail email.
- In the To field, enter the recipient’s email address.
- In the From field, choose the email address you want to send the email from.
- In the Subject field, enter your desired email subject.
- In the Body Type field, you can choose either a plain email or an HTML email.
- In the Body field, you can enter the parsed data.
Step 8: Send the Email Configuration to Test
Let’s send our email configuration to Gmail to test.
Step 9: Gmail Test Success
Great! Our Gmail test was a success. Let’s go over to our recipient’s email inbox and check the result.
Step 10: The Output Email
This is the email that the recipient will receive once we run our Zap.
Step 11: How to Create the Document Parser Template
We are going to show you three ways to parse the value in the table.
Using Virtual Grid
The easiest way to parse the value in the table is through the Virtual Grid. In the Document Parser Online Template Editor, click on the Add Object button and select Add FIELD mapped from VIRTUAL GRID.
Click on the Target icon button next to the Select Cell text field. This will open the table where the values are placed in individual cells.
Choose the Value in the table and click on the Use Selected Cell button.
Click on the Run Template button and it will return the value you selected.
Using Macros
Another way to parse the value in the table is using the Document Parser Macros. The Macros give you the flexibility to look for the value anywhere in the document. This type of search capability is made possible by Regex or Regular Expression. For non-Regex experts, the Macros will allow you to use Regex without its complexity.
In the Document Parser Online Template Editor, click on the Add Object button and select Add FIELD based on TEXT SEARCH.
In the Expression field, enter the search pattern. You can copy and paste this expression Organic Search{{Spaces}}(?{{Number}})
to find the Organic Search but only display the value 410. Put a checkmark on the Regex check box.
Click on the Run Template button to see the extracted value.
Using Regular Expressions
Last but not least is parsing the table value using the Regular Expression or Regex. We will use the same Add FIELD based on the TEXT SEARCH object.
In the Expression field, paste this Organic Search\s+(\d+)
search pattern to get the value 410 in the table. Tick the box in the Regex check box and Run the template.
In this tutorial, we learned how to parse a specific value in a table using the PDF.co Document Parser. We familiarized ourselves with three data parsing techniques. We used the parsed text and emailed it via Gmail. And, we were able to put the steps altogether in a single zap in Zapier.