Extract Text by Expression in Power Automate
PDF4me Extract Text by Expression action retrieves specific text patterns from PDF documents in Power Automate using powerful regular expression matching. This precision extraction feature targets exact data patterns like invoice numbers, email addresses, phone numbers, dates, and custom formats, with page-specific control, returning matched text as array for automated data processing and validation across Microsoft 365 workflows.
Authenticating Your API Request
To access the PDF4me Web API through Power Automate, every request must include proper authentication credentials. Authentication ensures secure communication and validates your identity as an authorized user, enabling seamless integration between your Power Automate flows and PDF4me's powerful pattern-based extraction services.

Key Features
- Regular Expression Support: Use regex patterns for precise text matching
- Pattern-Based Extraction: Target specific data formats and structures
- Page-Specific Control: Extract from specific pages or all pages
- Array Output: Receive all matches as array for iteration
- Multiple Matches: Extract all occurrences of pattern in document
Parameters
Complete list of parameters for the Extract Text by Expression action. Configure these parameters to control pattern extraction.
Important: Parameters marked with an asterisk (***) are required and must be provided for the action to function correctly.
| Parameter | Type | Description | Example |
|---|---|---|---|
| File Content*** | Binary | Source PDF File Content • Map PDF file from previous action • Must contain text for pattern matching • Supports PDFs from SharePoint, OneDrive, email • Can be dynamically retrieved from flows | [File Content from Get File] |
| File Name*** | String | PDF Document Name • Name of the PDF file • Used for processing identification • Should include .pdf extension • Supports dynamic naming | Invoice.pdf |
| Expression*** | String | Regular Expression Pattern • Regex pattern to match text • Use standard regex syntax • Examples: \\d{3}-\\d{3}-\\d{4} for phone, INV-\\d{5} for invoice numbers• Must be valid regex pattern | INV-\\d{5} |
| Page Sequence*** | String | Page Selection • Pages where content should be extracted • Use numbers: 1,2,3 for specific pages• Use all for all pages• Use ranges: 1-5 for page ranges | all |
Output
The PDF4me Extract Text by Expression action returns comprehensive output data for seamless Power Automate flow integration:
- Table
- JSON
- Flow Integration
Table View
Response data in a structured table format:
| Parameter | Type | Description |
|---|---|---|
| Text List | Array of Strings | Array containing all text matches found by the expression |
JSON Response Format
{
"Text List": [
"INV-12345",
"INV-12346",
"INV-12347"
]
}
Power Automate Flow Usage
Use extracted text matches in subsequent actions:
- Data Validation: Validate extracted values against databases
- Database Import: Load matched data into systems
- Email Notifications: Send alerts with extracted information
- Conditional Logic: Route based on extracted values
- Excel Export: Save extracted data to spreadsheets
- API Integration: Send extracted data to external systems
Workflow Examples
The PDF4me Extract Text by Expression action in Power Automate provides comprehensive workflow templates designed for real-world business scenarios:
- Invoice Number Extraction
- Email Extraction
- PO Number Extraction
- Date Extraction
Automated Invoice Number Extraction and Validation
Transform invoice processing with automated invoice number extraction:
Complete Workflow Steps:
- Trigger: Invoice PDF received via email
- Get Invoice: Extract PDF from email attachment
- Extract Invoice Number: Use regex
INV-\\d{5}to find invoice number - Validate Format: Check extracted number matches expected format
- Check Duplicates: Query database for existing invoice number
- If New: Process new invoice in accounting workflow
- If Duplicate: Flag for review and notify AP team
- Archive Invoice: Store with extracted invoice number as metadata
Business Benefits:
- Extracts invoice numbers from 300+ invoices monthly
- Prevents duplicate invoice processing
- Reduces manual number entry errors by 100%
- Accelerates invoice validation by 80%
Automated Email Address Extraction from Documents
Streamline contact management with automated email extraction:
Complete Workflow Steps:
- Trigger: Business card scan or contact PDF uploaded
- Get Document: Retrieve PDF from upload folder
- Extract Emails: Use regex
[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}to find emails - Validate Emails: Check email format validity
- Remove Duplicates: Filter out duplicate addresses
- Import to CRM: Add email addresses to Dynamics 365
- Create Contact: Generate contact records for each email
- Email Confirmation: Send import summary to sales team
Business Benefits:
- Extracts emails from 100+ documents weekly
- Automates contact list building
- Eliminates manual email transcription
- Accelerates CRM data entry by 90%
Automated Purchase Order Number Extraction
Optimize order processing with automated PO number extraction:
Complete Workflow Steps:
- Trigger: Order confirmation PDF received from supplier
- Get Confirmation: Retrieve PDF from email
- Extract PO Number: Use regex
PO-\\d{6}to find PO number - Validate PO: Check against open purchase orders in ERP
- Match Order: Link confirmation to original PO
- Update Status: Mark PO as confirmed in system
- Calculate Delivery: Estimate delivery based on confirmation
- Email Procurement: Notify procurement team of confirmation
Business Benefits:
- Processes 150+ order confirmations monthly
- Automates PO matching and tracking
- Reduces order tracking errors by 85%
- Accelerates order confirmation processing by 70%
Automated Date Extraction for Deadline Tracking
Enhance deadline management with automated date extraction:
Complete Workflow Steps:
- Trigger: Contract or agreement PDF uploaded
- Get Document: Retrieve contract PDF
- Extract Dates: Use regex
\\d{2}/\\d{2}/\\d{4}to find dates - Parse Important Dates: Identify start date, end date, milestones
- Create Calendar Events: Add dates to Outlook calendar
- Set Reminders: Create reminder tasks 30 days before deadlines
- Update Database: Log contract dates in tracking system
- Email Stakeholders: Send date summary to contract owners
Business Benefits:
- Extracts dates from 75+ contracts monthly
- Automates deadline tracking and calendar creation
- Reduces missed deadlines by 95%
- Ensures proactive deadline management
Industry Use Cases & Applications
- Finance & Accounting
- Legal & Professional Services
- Healthcare & Medical
- Corporate & Business
Finance & Accounting Use Cases
- Invoice Numbers: Extract invoice and order numbers
- Account Numbers: Parse account identifiers from statements
- Transaction IDs: Extract transaction reference numbers
- Amount Extraction: Parse monetary values from documents
Legal & Professional Services Use Cases
- Case Numbers: Extract case and matter numbers
- Date Extraction: Parse important legal dates and deadlines
- Reference Numbers: Extract citation and reference identifiers
- Contact Information: Parse attorney and client contact details
Healthcare & Medical Use Cases
- Patient IDs: Extract patient identification numbers
- Medical Record Numbers: Parse MRN from documents
- Insurance Numbers: Extract policy and claim numbers
- Test IDs: Parse lab test reference numbers
Corporate & Business Use Cases
- Order Numbers: Extract purchase and sales order numbers
- Product Codes: Parse SKU and product identifiers
- Reference Numbers: Extract tracking and reference codes
- Contact Details: Parse phone numbers and email addresses