Skip to main content

Having difficulty in dynamically renaming files ? Rename PDFs in Power Automate Using Parsed Data !

· 18 min read
SEO and Content Writer

What this flow does

PDFs landing in your folder as document.pdf or invoice (1).pdf are hard to find and match to the right record. This Power Automate flow uses PDF4me Parse Document to pull a value — invoice number, PO, contract ID, or customer name — from inside the PDF and saves the file with that value as its name. Three actions, no code: Get file content using path → Parse Document → Create file. Same content, findable filename, every time.

Three Things to Know Before You Build

Parse Document returns JSON, not the file
The PDF4me Parse Document action outputs only the extracted field values in a parseInfo JSON object. It does not pass through the file binary. In the Create file action you must map File Content from the Get file content using path Body — not from Parse Document — or the upload will fail.
The Template Name comes from the PDF4me Dashboard
Before you touch Power Automate you need a parse template. Log in to the PDF4me Dashboard, upload a sample PDF, draw capture areas for the fields you want to extract (for example Invoice No), and save. Copy the Template Name — you'll paste it directly into the Parse Document action field.
Dropbox is the example, not a requirement
All screenshots use Dropbox so the steps match a real run. The same pattern works with SharePoint, OneDrive, Google Drive, or any connector that has a "get file" and "create file" action. Swap in the right actions for your storage — the Parse Document step and the filename expression are identical regardless of where your files live.

What You Need Before You Start

  • Power AutomateOpen Power Automate, sign in (Microsoft 365 / Power Platform), and create a new cloud flow (e.g. Automated cloud flow or Instant cloud flow). You'll add one trigger and three actions.
  • PDF4me API keyGet your PDF4me API key (free to start). When you add the Parse Document action, you'll create a connection; the status will show Connected to PDF4me Connect. First time? Follow Connect PDF4me to Power Automate.
  • File storage — This guide uses Dropbox for Get file content using path and Create file so you can follow the screenshots step by step. It's not Dropbox-only: the same flow works with SharePoint, OneDrive, Google Drive, or other connectors. Swap in the equivalent "get file" and "create file" actions for your storage—the logic stays the same.

From scratch: Create the flow → Add Manually trigger a flow (or another trigger) → Add the three actions in order: Get file content using pathParse DocumentCreate file. Configure each step as below.

The Flow at a Glance

Your Power Automate flow for dynamic file renaming with PDF4me looks like this:

  1. Manually trigger a flow — Use for testing, or an automated trigger (e.g. When a file is created in a folder) so the flow runs whenever a new PDF is available.
  2. Get file content using path (Dropbox) — Gets the PDF from a path (e.g. /blog data/invoice_pdf4me.pdf). Output: the file content (Body) and metadata. You pass the Body to Parse Document and to Create file.
  3. Parse Document (PDF4me) — Extracts the field you need (invoice number, customer name, order number) into parseInfo. Output is JSON only; the file content stays from the previous action. You use the Parse Document output for the new filename.
  4. Create file (Dropbox) — Saves the file to a folder with File Name set to the parsed value (e.g. Pdf4me-202601-32324.pdf) and File Content = Body from Get file content. Same file, new name.
Power Automate flow: Manually trigger a flow → Get file content using path → Parse Document → Create file

Step 1: Create the Parse Template and Get the Template Name

First, define what to extract for your file names. A PDF4me parse template tells the API which field to pull from each document—e.g. invoice number, customer name, or order number. You'll use the template's Template Name (or Template ID) in Power Automate in Step 2.

Use the same PDF4me account for both: log in to the dashboard to create the template and use that account when you connect the Parse Document action in Power Automate.

  1. Sign in or create an account at the PDF4me Dashboard (opens in new tab—keep this guide open).
  2. Go to Parse Document (or use the login link with return URL if needed—same link as above).
  3. Create a template: Upload a sample PDF that matches the documents you'll receive. Add keys for each field you want to extract (e.g. Invoice No, customerName, orderNumber) and draw capture areas on the document for each key.
  4. Click Test Parse to see the extracted values, then Save Changes.
  5. Copy the Template Name (e.g. Blog-test) or Template ID from the dashboard—you'll enter it in the Parse Document action in Power Automate in the next step.

For detailed template setup, see Prepare Parse Info for Document (capture areas, regex, multiple keys).

PDF4me Parse Document dashboard: template, Template Name, keys, and parse result

Step 2: Get File Content and Parse Document in Power Automate

Next, get the PDF into the flow and extract the naming value with PDF4me. The file comes from Get file content using path (Dropbox). You'll pass that content to Parse Document and later use the same content for Create file.

Flow so far: Trigger → Get file content using path → Parse Document.

Important: Parse Document returns only JSON (parseInfo with your keys)—it does not pass through the file content. The file content stays from Get file content using path. In Step 3 you'll use Body from Get file content for the new file's content and the Parse Document output for the new file's name.

  1. Add a trigger — Click + New step → add Manually trigger a flow (for testing) or When a file is created (Dropbox) for automation.
  2. Add Get file content using path (Dropbox) — Click + New step → search Dropbox → select Get file content using path.
    • File Path * — Enter the path to your PDF, e.g. /blog data/invoice_pdf4me.pdf. Use the folder icon to browse if needed.
    • Advanced parameters — Open and set Infer Content Type to Yes so Power Automate detects the file type correctly.
    • Ensure you're Connected to Dropbox. Use Change connection reference if you need to switch accounts.
    • The action outputs Body (the file content) and other metadata. You'll pass Body to Parse Document and to Create file.
Power Automate Get file content using path: File Path /blog data/invoice_pdf4me.pdf, Infer Content Type Yes, Connected to Dropbox
  1. Add Parse Document (PDF4me) — Click + New step → search PDF4me → select Parse Document.
    • File Content — Click inside the field, then Add dynamic content → select Body from Get file content using path (the PDF binary).
    • File Name — Enter a name for the document being parsed, e.g. Test.pdf, or use a dynamic value from the trigger if available.
    • Template Name — Enter the Template Name you copied from the dashboard in Step 1 (e.g. Blog-test).
    • Ensure you're Connected to PDF4me Connect. Use Change connection reference to use your PDF4me API key.
    • The action returns body with parseInfo containing your keys (e.g. body.parseInfo['Invoice No']). You'll use this in the Create file step for the filename.
Power Automate Parse Document: File Content from Get file content, File Name Test.pdf, Template Name Blog-test, Connected to PDF4me Connect

Full parameter reference: Parse Document (Power Automate).


Step 3: Create File with the New Name

To save the same file with a new name, the Create file action needs the file content (from Get file content using path) and the filename (from Parse Document). In Power Automate you don't need a separate merge step—you map File Content from the first action and File Name from an expression that uses the Parse Document output.

  1. Add Create file (Dropbox) — Click + New step → search Dropbox → select Create file.

    • Folder Path * — Enter the target folder, e.g. /blog data (or your chosen output folder).
    • File Name * — Use an expression so the name is dynamic. Click the File Name field → click the fx (expression) icon or switch to the Expression tab → paste this formula:
    concat(outputs('Parse_Document')?['body']?['parseInfo']?['Invoice No'], '.pdf')

    Replace Parse_Document with the exact name of your Parse Document action if it's different. Replace 'Invoice No' with your template key (use bracket notation for keys with spaces). The expression appends .pdf so the file keeps the correct extension.

    • File Content * — Click inside the field → Add dynamic content → select Body from Get file content using path (the PDF content). Do not use the output of Parse Document—that returns JSON, not the file.
    • Ensure you're Connected to Dropbox.
Power Automate Create file: Folder Path /blog data, File Name expression concat(Parse_Document parseInfo Invoice No, .pdf), File Content from Get file content

The flow creates a new file with the parsed value as the name and the same content. The original file remains in its location unless you add a separate step to delete or move it.

Gotcha: File Content in Create file must come from Get file content using path (Body). File Name must come from the Parse Document output (e.g. outputs('Parse_Document')?['body']?['parseInfo']?['Invoice No']). If your template key has no space, you can use outputs('Parse_Document')?['body']?['parseInfo']?.invoiceNr (dot notation).


Real-World Scenarios

Scenario 1: Vendor Invoice Processing

Problem: A vendor receives dozens of PDF invoices per week from Dropbox, email, or an invoice generator. Files arrive as document.pdf or invoice (1).pdf—hard to find and match to payments.

Solution: Use this flow to rename each file by invoice number (e.g. INV-202601-32324.pdf). Each file is searchable and traceable.

Extract field: Invoice number (or invoice ID) Trigger: Manually for testing, or When a file is created in a folder (Dropbox)

Scenario 2: Purchase Order Documents

Problem: A procurement team gets PO PDFs from suppliers or internal systems. Generic filenames make it difficult to link documents to orders in their ERP.

Solution: Rename each PO PDF by order number (e.g. PO-98765.pdf).

Extract field: PO number Trigger: Dropbox folder, schedule, or file trigger

Scenario 3: Customer Contracts

Problem: A legal or sales team receives signed contracts from various sources. Finding a specific contract by client name or contract ID requires opening files one by one.

Solution: Rename by customer name or contract ID (e.g. Acme-Corp-202601.pdf).

Extract field: Customer name or contract ID Trigger: When a file is created, email, or SharePoint

Scenario 4: Order Confirmations and Shipping Docs

Problem: An operations team receives order confirmations or shipping labels. Matching documents to orders for tracking and audit requires searchable filenames.

Solution: Rename by order number or tracking ID (e.g. ORD-12345.pdf or TRK-ABC123.pdf).

Extract field: Order number or tracking ID Trigger: Dropbox folder, email, or file trigger


Frequently Asked Questions

Can I use SharePoint or Google Drive instead of Dropbox?+
Yes. The flow pattern is identical for any storage connector. Replace Get file content using path and Create file with the equivalent actions for SharePoint, OneDrive, or Google Drive — for example Get file content and Create file in SharePoint. The Parse Document step and the filename expression stay exactly the same. Only the trigger and storage actions change.
What if I want to combine two fields in the filename?+
Use a concat expression with both parse keys, for example: concat(outputs('Parse_Document')?['body']?['parseInfo']?['customerName'], '_', outputs('Parse_Document')?['body']?['parseInfo']?['invoiceNr'], '.pdf'). You can concatenate as many fields as you need separated by underscores or hyphens. Make sure all keys match the names you defined in the parse template exactly.
What if the parse template key has a space?+
Use bracket notation in the expression: outputs('Parse_Document')?['body']?['parseInfo']?['Invoice No']. Bracket notation handles spaces and special characters in key names. For keys without spaces you can use dot notation: outputs('Parse_Document')?['body']?['parseInfo']?.invoiceNr. Both approaches work — choose based on how your template keys are named.
Does Parse Document change or modify my file?+
No. Parse Document only reads the file content you map to it and returns a JSON object with the extracted field values under parseInfo. It does not alter the file, re-encode it, or return a modified binary. That is why the Create file action must use the Body from Get file content — the exact original file — not anything from Parse Document.
What triggers can I use instead of Manually trigger a flow?+
Any trigger that provides or leads to file access. Common choices: When a file is created in a folder (Dropbox), When a file is created or modified (SharePoint), a scheduled Recurrence that runs a list-and-fetch pattern, or an HTTP request trigger for webhook-based automation. Swap in whichever trigger matches your workflow — the three core actions (get file → parse → create file) stay the same regardless of what fires the flow.

Want to Go Deeper?

ResourceDescription
Connect PDF4me to Power AutomateCreate the PDF4me connection and add your API key
Parse Document — Power AutomateFull action reference: parameters, output, and flow ideas
Rename PDFs by barcode in Power AutomateSame flow pattern but using barcode text instead of parsed fields
Rename files with Parse Document (n8n)Same idea in n8n—download, parse, merge, upload

Next Steps

Recap: Trigger → Get file content using path → Parse Document (PDF4me) → Create file. The Parse template (Step 1) defines the field; Create file uses the Get file content Body for content and the Parse Document output for the filename.

  1. Get your API keyPDF4me API key dashboard (free to start). Use the same account for the dashboard and for the Parse Document connection in Power Automate.
  2. Create your parse template — Define the field(s) you want in the filename (invoice number, customer name, etc.) in the Parse Document dashboard and copy the Template Name.
  3. Build your flow — Trigger → Get file content using path → Parse Document → Create file with dynamic filename expression.
  4. Read the full docsParse Document (Power Automate), Prepare Parse Info.