Extract Invoice Details From SharePoint Using AI Builder in Power Automate

Recently, one of my clients asked if it’s possible to automatically extract key information from an invoice, such as Name, Amount, Item Description, Date, and Summary, as soon as the invoice file is uploaded to a SharePoint Document Library.

After exploring a few options, I found a simple and effective solution using Power Automate and AI Builder’s prompt capability.

In this tutorial, I will show you how to:

  • Automatically trigger a flow when an invoice is uploaded to a SharePoint library
  • Use an AI Builder prompt to extract information from the document
  • Save the extracted details into a SharePoint list

Extract Invoice Data Using AI Builder in Power Automate

Before building the flow, I created a SharePoint Document Library called Invoices, where all invoice files will be uploaded.

Extract Invoice Details from SharePoint Using AI Builder

Next, I created a SharePoint list named Invoice Details with the following columns:

Column NameType
Customer NameSingle line of text
Invoice DateDate and Time
Item DescriptionMultiple lines of text
AmountCurrency
SummaryMultiple lines of text
Power Automate Extract Invoice Details with AI Builder

Create the AI Builder Prompt

  1. Go to Power Automate -> Prompts tab. Click on Build your own prompt.
AI Builder Extract Invoice Data from SharePoint
  1. A new window opens where you can define how Copilot should interpret the user’s input.
Extract Invoice Information from SharePoint with Power Automate
  1. Give your prompt a name, like Extract Invoice Details.
  2. Upload a sample invoice file.
  3. In the prompt box, type something like:
You are tasked with extracting specific details from an invoice document. The goal is to identify and retrieve the following information accurately:

- Customer Name
- Invoice Date
- Item Description
- Amount
- Summary

### Instructions:
1. Carefully analyze the provided invoice document.
2. Extract each of the required details explicitly from the document content.
3. Ensure that the extracted information is accurate and corresponds exactly to what is present in the invoice.
4. Present the extracted details in a clear and organized manner.

### Output Format:
Respond with a JSON object containing the extracted fields as keys and their corresponding values from the invoice document. The JSON structure should be as follows:

Fill in the values with the exact text extracted from the invoice.

Provide the invoice document here: Invoice Document
Automate Invoice Data Extraction from SharePoint
  1. Run a test and confirm the extracted output.
Power Automate AI Invoice Processing from SharePoint

Once the prompt is tested and working correctly, we’ll use it inside Power Automate to extract data from uploaded invoices.

Create a Power Automate Flow to Extract Invoice Data

Follow the steps below to create the complete flow:

  1. Go to Power Automate. Click on Create > Automated Cloud Flow. Enter a name like Extract Invoice Info from PDF. Choose the trigger: When a file is created (properties only) from the SharePoint connector. Provide the parameters below:
    • Site Address: Select the site where the Invoices library is located.
    • Library Name: Select Invoices.
AI Builder Invoice Extraction in Power Automate
  1. Add Get file content from SharePoint and provide the following parameters:
    • Site Address: Same as above.
    • File Identifier: Use the Identifier from the trigger.
Read Invoice Data from SharePoint using AI Builder
  1. Then, add a Run a prompt action and provide the following parameters:
    • Prompt: Select the prompt that we created above.
    • Invoice Document: provide output from the Get file content action.
SharePoint Invoice Processing with Power Automate AI Builder
  1. Add the Create item action from the SharePoint connector and provide the following parameters:
    • Site Address: Same site.
    • List Name: Invoice Details
    • Customer Name: Use value from AI output
    • Invoice Date: Use extracted date
    • Item Description: Use the description
    • Amount: Use extracted amount
    • Summary: Use the extracted summary
Use AI Builder to Extract Invoice Fields from SharePoint

Now that your flow is ready, save the flow in Power Automate. Go to your SharePoint Document Library (Invoices). Upload an invoice file (PDF, image, or other supported format).

Capture Invoice Data Automatically from SharePoin

Once the file is uploaded, the flow will automatically run in the background. Now go to the Invoice Details list. You should see a new item with all the extracted information

Extract Invoice Details from SharePoint Using AI Builder in Power Automate

This way, you can get the invoice details from SharePoint using AI Builder in Power Automate.

You may also like:

Power Apps functions free pdf

30 Power Apps Functions

This free guide walks you through the 30 most-used Power Apps functions with real business examples, exact syntax, and results you can see.

Download User registration canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App