Parse Document in Power Automate
PDF4me Parse Document runs your saved parse template against a PDF inside a Power Automate flow and returns a Trace ID plus the extracted field data ready to use as dynamic content. Pipe File Content from SharePoint, Outlook, OneDrive, or Dataverse, reference the template by Template Name (TemplateId), and route the parsed values straight into a SharePoint list update, a Dataverse row create, an Outlook email, or a Teams notification. One action, one template, every Microsoft 365 workflow.
Before you run this action: create a parse template in the PDF4me dashboard. Define your capture keys and pick Regex Expression for stable patterns or JavaScript Expression for conditional logic. The Power Automate action references that template by TemplateId. See Prepare Parse Info for Document for full setup, Regex examples (INV-\d{6,10}, \d{2}/\d{2}/\d{4}), and two working JavaScript Expression classifier samples.
Authenticating Your API Request
The PDF4me Connect connector in Power Automate requires a valid Connection holding your PDF4me API key. Create the connection once at flow creation, then every PDF4me action in your tenant reuses it.
Important Facts You Should Not Miss
text variable for classification and fallback rules then route on it with Condition or Switch.
Parameters
| Parameter | Required | What it does | Example |
|---|---|---|---|
| File Content | Yes | Binary PDF as dynamic content from a prior Microsoft 365 action: SharePoint Get file content, Outlook Get attachments, OneDrive Get file content, Dataverse Download file. Must be a valid PDF. | @triggerOutputs()?['body'] |
| File Name | Yes | Source filename including .pdf extension. Usually mapped as dynamic content from the same upstream action File Name output. | Invoice_12345.pdf |
| Template Name | Yes | TemplateId GUID from the PDF4me dashboard. Identifies which parse template (capture keys + extraction rules) the action should apply. | 12345678-1234-1234-1234-123456789abc |
Expression types in your parse template
Regex ExpressionStable patternsINV-\d{6,10}), dates (\d{2}/\d{2}/\d{4}), amounts ($?\d{1,3}(?:,\d{3})*(?:.\d{2})?). Around 80% of production capture keys.JavaScript ExpressionConditional logic and classifierstext; return a string. Multi-marker classification, fallback rules, date normalization. See Prepare Parse Info for Document for two working samples.Output
The action returns a Trace ID plus the parsed field data as dynamic content available to every downstream action.
| Field | Type | What it contains |
|---|---|---|
Trace-Id | String | Unique identifier for the parse operation. Log it to a SharePoint list or Dataverse table for audit and troubleshooting. |
Parsed fields | Object | One dynamic-content field per capture key in your template (invoiceNumber, totalAmount, invoiceDate, etc). Reference them directly in any downstream action. |
Flow examples
Common Power Automate flow patternsTypical ways to chain Parse Document into a Power Automate flow.
- Outlook When a new email arrives trigger fires on inbox/AP.
- Apply to each on attachments filters PDFs only.
- Parse Document runs the Invoice template against the attachment.
- Dataverse Add a new row writes invoiceNumber, totalAmount, vendorName into the Invoices table.
- Teams Post a message in a chat or channel notifies the AP team.
- SharePoint When a file is created in a folder trigger fires on /Documents/Invoices.
- SharePoint Get file content loads the PDF binary.
- Parse Document extracts the invoice fields.
- SharePoint Update item writes the parsed values back to the metadata of the same item.
- Forms or Power Apps submission delivers a PDF.
- Parse Document runs a template with a JavaScript Expression key returning the document type.
- Switch action routes on the type field (invoice / order / contract).
- Each branch posts the parsed values to the right destination (Dynamics, SharePoint, Outlook approval).