Extract PDF Invoice Data into Google Sheets Using PDF.co and Zapier

Creating and sending invoices takes time and effort, especially when it is done manually. Moreover, to process those invoices, the data need to be scanned and transformed. Automation can save time tremendously and provide better data accuracy.

The PDF format for invoices is your optimal choice whether you need to send a bill to your client or process an incoming invoice.

In this article, we will show you how to automatically extract invoice line items from PDFs uploaded to Google Drive and save them as rows in Google Sheets.

Step 1: Prepare Google Drive and Google Sheets

Create a Google Drive folder for incoming PDF invoices. Keep each invoice in its own file; a single invoice can contain multiple pages.

Create a Google Sheet with these column headers in the first row:

  • Source File
  • Description
  • Quantity
  • Unit Price
  • Line Total

Upload a sample invoice containing several line items to the input folder.

Step 2: Set Up the Google Drive Trigger

  1. Create a new Zap.
  2. Select Google Drive and the New File in Folder trigger.
  3. Connect your Google account.
  4. Select the drive and input folder.
  5. Test the trigger and select your sample PDF.

Step 3: Extract the Invoice Data

  1. Add PDF.co and select AI Invoice Parser.
  2. Sign in and authorize your PDF.co account.
  3. In Source File URL, map the File value from Google Drive.
  4. Leave Custom Fields empty for this example.
  5. In Line Item Structure, enter:
{
  "description": "string",
  "quantity": "number",
  "unitPrice": "number",
  "lineTotal": "number"
}

This defines consistent field names for the extracted line items. AI Invoice Parser detects the invoice layout automatically, so no parsing template is required. See the AI Invoice Parser documentation for configuration details.

Test the action. Review the returned lineItems and compare the descriptions, quantities, prices, and totals with the original invoice.

Step 4: Add the Line Items to Google Sheets

  1. Add Google Sheets as the next app.
  2. Select Create Multiple Spreadsheet Rows, which supports line items.
  3. Connect your Google account.
  4. Select the spreadsheet and worksheet.
  5. Map the fields as follows:
  • Source File: Filename from the Google Drive trigger
  • Description: description from the parser’s line items
  • Quantity: quantity from the parser’s line items
  • Unit Price: unitPrice from the parser’s line items
  • Line Total: lineTotal from the parser’s line items

Select the full line-item lists for the four extracted columns so each invoice item becomes a separate row. Keep the values as line items rather than combining them into comma-separated text.

Zapier’s Google Sheets setup guide describes the available row actions.

Step 5: Test and Publish

Test the Google Sheets action, then open the worksheet. Confirm that each invoice line item appears on its own row and that its description, quantity, price, and total remain aligned.

Publish the Zap after verifying the results. New PDF invoices added to the selected Google Drive folder will now be parsed and their line items added to Google Sheets.

In this tutorial, you learned to connect your Google Drive account to use the PDF Invoice in your Google folder. You were able to use this Google file with PDF.co’s AI Invoice Parser to parse the table line items. You also learned how to set up the Google Sheet to automatically add all the parsed line items in their corresponding columns and rows in one go.

Related Tutorials

See Related Tutorials