Skip to main content

Parse Document in Power Automate

What this action does

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.

Related Blog Posts(1)

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​

Template Name accepts the TemplateId GUID
Paste the GUID TemplateId from the dashboard rather than the human-readable template name. The GUID is stable across renames and is the safe production value.
Regex for stable patterns, JavaScript for conditional logic
Capture rules live in the template. Use Regex Expression for invoice numbers, dates, amounts. Use JavaScript Expression with the text variable for classification and fallback rules then route on it with Condition or Switch.
Native Microsoft 365 sources
File Content maps cleanly from SharePoint Get file content, Outlook Get attachments, OneDrive Get file content, and Dataverse Download file. Same TemplateId works from Make, n8n, Zapier, and direct REST.
Parse Document action in Power Automate

Parameters​

ParameterRequiredWhat it doesExample
File ContentOptionalContent of the document to parse. Map it from the file content returned by a previous action, such as SharePoint or OneDrive Get file content.@{body('Get_file_content')?['$content']}
File NameOptionalName of the document, including its extension (for example `invoice.pdf`).invoice.pdf
Template NameOptionalName of the parsing template to use, as set up in PDF4me.your value

Expression types in your parse template​

Regex ExpressionStable patterns
Invoice numbers (INV-\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 classifiers
The capture area text is passed as text; 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.

FieldTypeWhat it contains
traceIdTextTrace ID of the request, as returned by PDF4me.
parseInfoObjectValues read from the document. The connector defines no fields for this object; its contents depend on the parsing template. Use Parse JSON or expressions to read them.

Flow examples​

Common Power Automate flow patternsTypical ways to chain Parse Document into a Power Automate flow.
Outlook invoice to Dataverse
  1. Outlook When a new email arrives trigger fires on inbox/AP.
  2. Apply to each on attachments filters PDFs only.
  3. Parse Document runs the Invoice template against the attachment.
  4. Dataverse Add a new row writes invoiceNumber, totalAmount, vendorName into the Invoices table.
  5. Teams Post a message in a chat or channel notifies the AP team.
SharePoint library to list update
  1. SharePoint When a file is created in a folder trigger fires on /Documents/Invoices.
  2. SharePoint Get file content loads the PDF binary.
  3. Parse Document extracts the invoice fields.
  4. SharePoint Update item writes the parsed values back to the metadata of the same item.
Classify-and-route flow
  1. Forms or Power Apps submission delivers a PDF.
  2. Parse Document runs a template with a JavaScript Expression key returning the document type.
  3. Switch action routes on the type field (invoice / order / contract).
  4. Each branch posts the parsed values to the right destination (Dynamics, SharePoint, Outlook approval).

Frequently Asked Questions​

What goes in the Template Name field?+
Paste the TemplateId GUID from the PDF4me dashboard. Despite the field label, the GUID is the safer production value. It is stable across renames and identical to the value used by the REST API and the other platform connectors.
Where does File Content come from?+
Any Microsoft 365 action that returns a binary file: SharePoint Get file content, Outlook Get attachments, OneDrive Get file content, Dataverse Download file. Reference both File Content and File Name as dynamic content from that step.
What is Trace ID used for?+
Trace ID is a unique identifier for the parse operation. Log it to a SharePoint list or Dataverse table to maintain an audit trail. Reference it in error notifications so support staff can find the operation in PDF4me logs.
Can I classify documents at parse time using JavaScript?+
Yes. Inside the template add a JavaScript Expression on a capture key. The capture area text is passed as the variable text and your function returns a string. Use it for invoice vs order classification, then route on it with a Power Automate Switch or Condition action.
How do I write the parsed values back to the source SharePoint item?+
In SharePoint, the trigger When a file is created or modified gives you the item ID. Pass the file binary to Parse Document, then use SharePoint Update item with the same ID to write each parsed key (invoiceNumber, totalAmount, etc) into the column with the matching name.
Does it work with Power Automate Desktop or only with Power Automate (cloud)?+
The PDF4me Connect connector is a cloud connector available in Power Automate (the web flow designer). For desktop automation, call the same Parse Document REST endpoint with the HTTP action.

Same task on other platforms​

Get Help​