Skip to main content
search

Automating Invoice Data Extraction with Power Automate and GPT

By September 2, 2024October 17th, 2024Automation, AI, Uncategorized
Automating Invoice Data Extraction with Power Automate and GPT

Think back to a time handling dozens, or even hundreds, of invoices every day using just email, SharePoint, and accounting software. It sounds like a logistical nightmare – but with the right workflow in place, it doesn’t have to be. 

What if we told you that this entire process could be automated? That’s what we did for one of our clients. 

We created a streamlined workflow that extracts key information from structured PDF invoices using GPT, saves them to SharePoint, and enters the data into their internal accounting system – all without breaking a sweat. 

Through this case study, we’ll explore how we made it happen and how automation turned a tedious task into an effortless experience.

Client’s Pain Points in Manual Invoice Processing

Clients Pain Points in Invoice Management

The project was initiated to simplify the process of managing invoices and related data for a logistics and transportation company specializing in moving and relocation services. They provide a range of solutions including residential and commercial moving, storage, and logistics management.

Our client was struggling with managing and processing invoices efficiently. The main challenge was managing a high volume of invoices received daily from various ports and shipment sources. These invoices detail charges for services provided, including transit and delivery fees. 

They had to juggle multiple folders for different types of invoices for rejected and received invoices, extraction data, and other categories.

The existing manual workflow was time-consuming, prone to errors, and required significant manual intervention. 

It was difficult dealing with multiple PDF invoices, each with a different structure. Extracting consistent and accurate information from these documents – such as invoice number, invoice date, total amount, and company name – required a robust and flexible solution. 

Ensuring high accuracy across different formats and maintaining data integrity were the client’s critical goals.

Bitcot’s Automation-Based Invoice Data Extraction Software Solution

Bitcots Automated Invoice Data Extraction Solution

Our team developed a customized solution to extract invoice data from PDFs. 

In this project, multiple flows are at play to automate invoice extraction, each tailored to its optimal environment. Desktop flows are leveraged for tasks that are more efficiently executed directly on a desktop, such as managing local files, interacting with desktop applications, or performing automated tasks that require a specific machine environment. 

On the other hand, cloud flows handle tasks best suited for the cloud, like integrating with cloud-based services, managing online data, or automating workflows that need to be accessible across multiple devices or locations. 

By combining both desktop and cloud flows, we achieved a more versatile, efficient, and robust automation strategy. 

Also, to streamline the data analysis process, we used GPT to extract data from PDFs efficiently.

1. Folder Structure Setup

We began by establishing a comprehensive folder structure both on the GSA site and on the desktop. A dedicated folder named was created under the GSA site on SharePoint to house all related files.

  • GSA Site: Created folders for rejected invoices, received invoices, extraction data, and others.
  • Desktop: Implemented a similar folder structure to capture errors and save all extraction data and PDFs.

2. Automated Flow Creation

To extract data from an email using Power Automate, we set up a flow that triggers upon receiving an email with specific criteria:

  • Sent from a designated email ID to another specific ID.
  • Subject line must include “Invoice”.
  • Email body must include GSA number, shipment type, shipper name, and company name.
  • Invoices are attached to the email (PDF format).

When these criteria are met, the flow is activated and starts processing.

3. Email Data Extraction

Upon receiving the email, critical information (GSA Number, Shipment Type, Shipment Number) is extracted from the email body and stored in an Excel file on SharePoint.

To extract data from an email body to Excel using Power Automate, we used the flow that reads the email content and transfers the relevant information into an Excel spreadsheet.

4. Invoice Storage on SharePoint

The invoice is saved onto SharePoint under the “Received Invoices” folder.

5. Common Flow Creation

For AI invoice extraction, we developed a flow using GPT (Generative Pre-trained Transformer) to standardize and automate the extraction of essential fields from the invoices. 

Despite the varied structures of the PDFs, we designed a universal flow capable of processing all invoices with diverse PDF formats. This flow leveraged GPT’s advanced text extraction capabilities to handle variations in invoice layouts.

We designed a single, robust prompt to instruct GPT on how to extract data from PDF to Excel with Power Automate. This prompt was crafted to be flexible enough to handle different invoice structures.

6. Invoice Data Extraction Using AI

  • The GPT flow creates a local folder on the user’s desktop, mirroring the structure of the SharePoint site. Inside this folder, an “Extractor Report” is generated.
  • This scheduled flow is set to run daily, automatically triggering the data extraction process. It downloads the necessary files from SharePoint, extracts data from the invoices, and updates the extraction report with details such as:

          1) Company Name

         2) Invoice Number

         3) Invoice Date

         4) Total Amount

         5) Shipment Name

         6) Extraction Date

         7) Shipment Type (extracted from the email body)

         8) GSA Number (extracted from the email body)

  • The flow also automatically creates a sub-folder with the current date, organizing the extracted data by date for easy reference.

7. Data Accuracy and Validation

Once the data is extracted, it’s saved and validated. The results show:

  • Invoice Number: Accurate across all invoices.
  • Data Accuracy: High accuracy in the extracted data.
  • Company Name: Approximately 80% accuracy in matching company names.
  • Mismatch: Only one mismatch was observed for the invoice number.

8. Data Entry into STPro

We designed a desktop flow to update STPro with extracted invoice data. STPro is an internal desktop software used to manage shipment and registration details.

  • The flow automatically opens the STPro software, navigates to the “Shipment Form” section, and inputs the extracted data including the GSA/REG Number, Shipment Type, and Shipment Number. 
  • The STPro system searches for the GSA or GBL number. Depending on the type of number received:

          1) If a GSA number is present, it searches in the “regs” database.

          2) For a GBL number or any other number, the search occurs within the “GBL hash” database.

  • The system cross-references the shipper name and shipment type with the existing records.

          1) If the company name matches the records, the system checks and updates various fields like the estimated cost, actual cost, approval date, and invoice number.

          2) If discrepancies are found between the invoice and the STPro records, the process is halted, and a notification is sent for review. 

  • In cases where there is a mismatch in the company name between the invoice and STPro, the process allows for manual intervention to correct the data.
  • All relevant data is then saved automatically into the accounting system.
  • For successful data entry, the flow ensures that all required fields, such as Agency Number, First Paid Date, PU (Pick-Up), Origin and Destination Addresses, Email, and Mobile Number, are accurately populated.
  • The flow saves generated reports and invoices to SharePoint for accounting purposes.
  • We can refine the flow to handle various email senders and keywords.

9. Processed Data Storage

The automated process moves the processed data (a single PDF for the final invoice and cost sheet) to SharePoint, where it’s organized into a structured folder path: DOS 1 > BitcotDev > Invoice for Accounting to Pay.

  • A summary file is created under this directory, containing details like the shipper’s name, shipment type, and invoice information.
  • A new daily folder is created for organizing invoices by date.

10. Final Review and Submission

The manager reviews the invoice for approval, stamping it with dates for received, approved, and paid status.

Once approved, the invoice is sent to accounting for payment.

How the Client Achieved Groundbreaking Results

How the Client Achieved Groundbreaking Results

By using a combination of AI, manual checks, and systematic data entry into the STPro system, the process minimizes the risk of incorrect payments and ensures that all necessary approvals are documented. 

Enhanced Efficiency

  • Time Savings: Automation cut down the time required for managing invoices and related tasks by automating repetitive processes. This led to a significant reduction in manual effort.
  • Streamlined Workflow: The end-to-end automation of data extraction, storage, and entry improved overall workflow efficiency. Tasks that previously took hours are now completed in minutes, optimizing resource utilization.

Improved Accuracy

  • Consistent Data Extraction: The integration of GPT technology ensured accurate extraction of critical information from various invoice formats. This consistency in data capture reduced the likelihood of errors that typically arise from manual entry.
  • Error Reduction: Automated processes minimized human errors, such as incorrect data entry or misclassification of invoices, leading to higher reliability in financial records.

Better Organization

  • Structured Storage: The establishment of a well-organized folder structure on SharePoint and desktop made it easier to manage and access invoices and related documents. This structure provided clear pathways for sorting, storing, and retrieving files.
  • Efficient Document Retrieval: The improved organization system facilitated quicker access to needed documents, reducing time spent searching for files and enhancing overall productivity.

Reduced Manual Intervention

  • Decreased Manual Workload: Power Automate invoice processing and data entry minimized the need for manual intervention, lowering the risk of human errors and inefficiencies. Staff no longer needed to manually handle and input data, which streamlined operations.
  • Error Handling: The system’s ability to automatically handle discrepancies and provide options for manual correction ensured that errors were quickly addressed without disrupting the workflow.

Streamlined Data Entry

  • Automated Integration with STPro: The automated flow seamlessly updated STPro with invoice data, eliminating the need for manual data entry. This integration ensured that shipment and registration details were recorded accurately and promptly.
  • Improved Accuracy in Data Entry: By automating data entry into STPro, the solution reduced the risk of manual data entry errors, ensuring that all required fields were accurately populated.

Efficient Data Storage and Reporting

  • Organized Archiving: Processed invoices and reports were systematically stored in SharePoint, creating a well-organized archive. This organization in SharePoint invoice processing made it easier to track and manage historical data.
  • Daily Folder Creation: The creation of daily folders for organizing invoices by date facilitated better record-keeping and streamlined access to current and past invoices.

Faster Review and Approval

  • Accelerated Approval Process: The automation streamlined the review and approval of invoices, allowing managers to quickly review, stamp, and approve invoices for payment. This efficiency reduced delays and improved cash flow management.
  • Timely Payments: By expediting the approval process, the solution ensured that invoices were processed and sent to accounting more swiftly, leading to more timely payments and better financial management.

Final Thoughts

A great many invoices require manual intervention, and numerous accounting professionals report delays. 

How much are these inefficiencies and errors impacting your bottom line? How are these setbacks costing your business? 

Clearly, traditional methods that rely on manual data entry aren’t cutting it. So, what’s the better alternative?

AI and automation.

At Bitcot, we offer advanced solutions that leverage AI and automation tools to make invoicing easier. We’ll help you cut out the manual work, reduce mistakes, and speed things up, giving your financial management a much-needed upgrade.

If you’re wondering how to extract data from invoices, get in touch with our team to see how we can transform your invoicing process and boost your efficiency.

Raj Sanghvi

Raj Sanghvi is a technologist and founder of BitCot, a full-service award-winning software development company. With over 15 years of innovative coding experience creating complex technology solutions for businesses like IBM, Sony, Nissan, Micron, Dicks Sporting Goods, HDSupply, Bombardier and more, Sanghvi helps build for both major brands and entrepreneurs to launch their own technologies platforms. Visit Raj Sanghvi on LinkedIn and follow him on Twitter. View Full Bio