Skip to main content

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.

Extract Text by Expression Power Automate

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.

ParameterTypeDescriptionExample
File Content***BinarySource 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***StringPDF Document Name
• Name of the PDF file
• Used for processing identification
• Should include .pdf extension
• Supports dynamic naming
Invoice.pdf
Expression***StringRegular 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***StringPage 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 View

Response data in a structured table format:

ParameterTypeDescription
Text ListArray of StringsArray containing all text matches found by the expression

Workflow Examples

The PDF4me Extract Text by Expression action in Power Automate provides comprehensive workflow templates designed for real-world business scenarios:

Automated Invoice Number Extraction and Validation

Transform invoice processing with automated invoice number extraction:

Complete Workflow Steps:

  1. Trigger: Invoice PDF received via email
  2. Get Invoice: Extract PDF from email attachment
  3. Extract Invoice Number: Use regex INV-\\d{5} to find invoice number
  4. Validate Format: Check extracted number matches expected format
  5. Check Duplicates: Query database for existing invoice number
  6. If New: Process new invoice in accounting workflow
  7. If Duplicate: Flag for review and notify AP team
  8. 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%

Industry Use Cases & Applications

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

Get Help