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.

Next, I created a SharePoint list named Invoice Details with the following columns:
| Column Name | Type |
|---|---|
| Customer Name | Single line of text |
| Invoice Date | Date and Time |
| Item Description | Multiple lines of text |
| Amount | Currency |
| Summary | Multiple lines of text |

Create the AI Builder Prompt
- Go to Power Automate -> Prompts tab. Click on Build your own prompt.

- A new window opens where you can define how Copilot should interpret the user’s input.

- Give your prompt a name, like Extract Invoice Details.
- Upload a sample invoice file.
- 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

- Run a test and confirm the extracted output.

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:
- 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.

- Add Get file content from SharePoint and provide the following parameters:
- Site Address: Same as above.
- File Identifier: Use the Identifier from the trigger.

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

- 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

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).

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

This way, you can get the invoice details from SharePoint using AI Builder in Power Automate.
You may also like:
- Retrieve Specific Item in Power Automate
- Send an Email with Attachments in Power Automate
- Send Email Reminders from a SharePoint List using Power Automate
- Send an Email with Attachments from Local Folder using Power Automate
- The file Document.docx is locked for shared use by user in Power Auromate

Hey! I’m Bijay Kumar, founder of SPGuides.com and a Microsoft Business Applications MVP (Power Automate, Power Apps). I launched this site in 2020 because I truly enjoy working with SharePoint, Power Platform, and SharePoint Framework (SPFx), and wanted to share that passion through step-by-step tutorials, guides, and training videos. My mission is to help you learn these technologies so you can utilize SharePoint, enhance productivity, and potentially build business solutions along the way.