Automatically extract structured invoice data from documents in SharePoint or OneDrive using Microsoft Power Automate and the ParserData API, then save clean JSON results to SharePoint Lists, Excel, or other Microsoft 365 services.
This Power Automate flow creates a fully automated document processing pipeline:
- Triggers on new invoice uploads to SharePoint/OneDrive folder
- Downloads the document file
- Sends it to ParserData extraction API with structured prompt
- Parses the API response to extract invoice fields
- Saves structured data to SharePoint List, Excel Online, or sends via Teams/Email
- Trigger: New file uploaded to SharePoint document library
- Action: Extract invoice data using ParserData
- Output: Create item in SharePoint List with extracted fields
- Best for: Finance teams using SharePoint for document management
- Trigger: New invoice saved to OneDrive folder
- Action: Extract all invoice fields
- Output: Add row to Excel Online spreadsheet
- Best for: SMBs and accounting automation
- Trigger: New vendor invoice in SharePoint
- Action: Extract and validate invoice data
- Output: Send adaptive card to Microsoft Teams with invoice summary
- Best for: Approval workflows and team notifications
Before you start, ensure you have:
- Microsoft 365 account with Power Automate license
- SharePoint site or OneDrive account for file storage
- ParserData API key (Sign up)
- SharePoint List or destination for extracted data (optional)
- Go to Power Platform Admin Center (admin.powerplatform.microsoft.com)
- Navigate to Environments → Select your environment
- Go to Settings → Variables → Environment variables
- Click New → Create environment variable
- Display name: ParserData API Key
- Name:
ParserDataAPIKey - Data type: Text
- Values: Enter your actual API key
- Save
Why: This keeps your API key secure and allows easy rotation without modifying flows.
- Go to Power Automate
- Click + Create → Automated cloud flow
- Give it a name:
Invoice Processing - SharePoint to ParserData - Choose trigger: When a file is created (SharePoint) or When a file is created (OneDrive)
- Click Create
- Site Address: Select your SharePoint site
- Library Name: Select your document library (e.g., "Invoices")
- Folder: Optional - specify subfolder path
- Folder: Select the folder to monitor (e.g.,
/Invoices/Incoming)
Add a new step: Get file content
- Click + New step
- Search for "Get file content"
- Choose either SharePoint or OneDrive connector
- File Identifier: Use the dynamic content
Identifierfrom the trigger
Add a new step: HTTP (Premium connector)
- Click + New step → HTTP
- Configure:
| Parameter | Value |
|---|---|
| Method | POST |
| URI | https://api.parserdata.com/v1/extract |
| Headers | X-API-Key → Use environment variable |
- Click Show advanced options
- Headers:
Key: X-API-Key
Value: @{environmentVariables('ParserDataAPIKey')}
Add a new step: Parse JSON
- Click + New step → Parse JSON
- Content: Use the
Bodyfrom the HTTP action - Schema: Click "Generate from sample" and paste sample API response
Choose your destination:
- Add action: Create item (SharePoint)
- Map extracted fields to list columns
- Add action: Add a row into a table (Excel Online)
- Map extracted fields to table columns
- Add action: Post adaptive card and wait for response (Teams)
- Format extracted data as adaptive card
Add Configure run after settings:
- Click the three dots on HTTP action
- Select Configure run after
- Check: has failed, has timed out
- Add a parallel branch for error notifications
Power Automate provides built-in retry policies:
- Click on the HTTP action
- Select Settings (gear icon)
- Under Retry Policy:
- Count: 3 retries
- Interval: PT5M (5 minutes)
- Type: Exponential interval
Why exponential: Provides better recovery for transient API failures without overwhelming the service.
Modify the extraction prompt to extract different fields:
{
"prompt": "Extract purchase order number, vendor name, order date, delivery address, line items (product code, description, quantity, unit price, total), and approval status."
}- ✅ Use Environment Variables - Never hardcode API keys
- ✅ Limit SharePoint Permissions - Grant minimum required access
- ✅ Enable Flow Audit Logs - Track who runs flows and when
- ✅ Rotate API Keys Regularly - Update environment variable when rotating
- ✅ Use Data Loss Prevention (DLP) - Configure DLP policies for HTTP connector
- File Size Limits: Check documentation for latest limits
- Timeout: Set HTTP timeout to 5 minutes for large documents
- Concurrency: Power Automate handles concurrent flows automatically (check your plan limits)
- Rate Limits: ParserData API has rate limits - adjust flow frequency accordingly
| Issue | Solution |
|---|---|
| HTTP 401 Unauthorized | Verify API key in environment variable, check key is active |
| HTTP 429 Rate Limit | Reduce flow frequency, implement exponential backoff |
| Timeout Errors | Increase HTTP timeout in action settings |
| File Not Found | Verify SharePoint/OneDrive folder path and permissions |
| Malformed Response | Check API response format, update JSON schema if needed |
- Use Flow Checker to validate flow before saving
- Enable Flow Analytics to monitor performance
- Check Run History for detailed error messages
- Test with Test button using sample files
- Use Compose actions to debug intermediate values
- Endpoint:
POST https://api.parserdata.com/v1/extract - Headers:
X-API-Key: Your API keyContent-Type:multipart/form-data
- Body Parameters:
file: Binary file contentprompt: Extraction instructionsoptions: JSON withreturn_schemaandreturn_selected_fieldsflags
- Response: JSON with extracted fields
Full API documentation: https://parserdata.com/parserdata-api
MIT
This repository is a reference example. For production support or custom integration needs, contact support@parserdata.com.