AdemeroHelp

Create Business Central purchase invoices from Paige with Power Automate

Build the Power Automate flow that watches Paige's SFTP export folder, reads each invoice's field values, creates a draft purchase invoice in Dynamics 365 Business Central with a line at the total, and attaches the PDF — all with Microsoft's Business Central connector.

Administrators1.5 hoursVerified 2026-09-05

Before you begin

  • Business Central online, with a user who can create purchase invoices and whose account the flow will use
  • A Power Automate license that includes premium connectors (Business Central and SFTP - SSH are premium)
  • An SFTP server Paige can reach, with a folder for this scan job
  • A Paige scan job with an invoice document type whose fields include vendor number or name, invoice number, invoice date, due date, and total

At the end of this guide, every invoice Paige finishes becomes a draft purchase invoice in Business Central within minutes — vendor set, dates and vendor invoice number filled, a G/L line at the total, and the PDF attached as an incoming document — with no data entry.

The flow is: SFTP trigger → keep only the data file → Parse JSON → create the invoice → add the line → get the PDF → create the attachment record → upload its content. It uses the Dynamics 365 Business Central connector's Create record (V3) and Update an image, file or document (V3) actions against the standard v2.0 API.

Step 1 — Point Paige at your SFTP server

  1. In Paige, open Settings (the gear at the bottom of the left menu — administrators only), pick the scan job, and choose Export.

  2. Click the FTP card. Enter the FTP Address, Port 22, Username, Password, and in FTP Folder Path a folder for this scan job, such as /paige/invoices.

  3. Click Test Connection. What you should see: FTP connection successful! Connect — Connected to FTP Server! and a green Connected label.

  4. Turn on Enable Auto Export. Under Auto Export Settings, pick your invoice type under Document Types, set Auto Field Entry Complete to Yes, and set Human Reviewed to Reviewed. Click Save.

Open port 22 on your firewall to Paige's address ranges — Outbound IP ranges for firewall allow-lists.

Step 2 — Decide how the vendor is identified

Business Central's API takes either vendorNumber (the vendor's No.) or vendorId. The reliable choice is the vendor number. Give the Paige invoice type a Vendor Number field if your invoices carry your vendor code, or have the reviewer set it; otherwise the flow looks the vendor up by name with Find one record (V3) on the vendors table, which works when the invoice's spelling matches the vendor card exactly.

Step 3 — Build the flow

Create an Automated cloud flow. In every Business Central action, set Environment to yours, Company to yours, and API category to v2.0.

  1. Trigger — SFTP - SSH: When a file is added or modified. Connection: Host server address, User name, Password, Port number 22. Folder: the scan job's folder. Include file content on.

  1. Condition: File name ends with .json. Steps 3–8 go in If yes.

  1. Parse JSON on the trigger's File content, schema generated from a real .json.

  1. Dynamics 365 Business Central: Find one record (V3) (only if you match by name). Table name vendors; filter displayName eq the parsed Vendor Name. Its output number is the vendor number.

  1. Dynamics 365 Business Central: Create record (V3). Table name purchaseInvoices. Row:

    Field Value
    vendorNumber the vendor number (from step 4, or Paige's field)
    invoiceDate formatDateTime(<Invoice Date>, 'yyyy-MM-dd')
    dueDate formatDateTime(<Due Date>, 'yyyy-MM-dd')
    vendorInvoiceNumber the parsed Invoice Number

    The output includes the new invoice's id.

  1. Dynamics 365 Business Central: Create record (V3). Table name purchaseInvoiceLines. Row: documentId = the invoice id from step 5, lineType = Account, accountId = the G/L account's id (look it up once with Find one record (V3) on accounts, or paste the id), description = Paige – <document type>, quantity = 1, unitCost = float(replace(replace(<Total>, ',', ''), '$', '')).

    For itemized invoices, loop over the parsed line_items rows with Apply to each and create one line per row.

  1. SFTP - SSH: Get file content using path. Path: the folder plus the parsed pdf_file.

  1. Attach the PDF — two actions:

    • Create record (V3), Table name attachments. Row: parentId = the invoice id, parentType = Purchase Invoice, fileName = the invoice number plus .pdf. The output includes the attachment's id.
    • Update an image, file or document (V3). Path: pick attachments/attachmentContent from the picker; pathParameters id = the attachment id; body = the file content from step 7.
  1. Save. What you should see: the flow checker reports no errors.

Note

Business Central's connector caps a record at 8 MB. Invoice PDFs are usually well under that; for scanned documents that aren't, downscale in Paige's scan job settings or attach only the first pages.

Step 4 — Test it

  1. Process one invoice through the scan job in Paige, review it, and wait for the export.

  2. Open the flow's 28-day run history. What you should see: one successful run, every Business Central action 201.

  3. In Business Central, open Purchase Invoices. What you should see: the draft invoice with the vendor, dates, vendor invoice number, and the line at the total; the PDF under Attachments in the FactBox. Post it as you normally would.

When it doesn't work

SymptomWhere to look
The flow never runsWrong SFTP folder, or a subfolder. Files over 50 MB are skipped by this trigger.
Runs four times per invoiceThe .json condition is missing.
Create record fails on the vendorNo vendor with that number, or the name lookup found nothing. Correct the vendor field in Paige during review.
Create record fails on a dateUse formatDateTime(..., 'yyyy-MM-dd'); Paige exports dates as printed.
Line fails on accountIdIt's the account's GUID id, not its number. Look it up once.
Attachment record created but emptyThe content update targeted the wrong id, or the body wasn't the raw file content.
Nothing arrives from PaigeAuto-export criteria aren't met, or the invoice was processed before you enabled auto export. Export once from the Documents page with Export and tick FTP.

If the Paige side is the problem, contact Ademero support with the scan job name and the message from Test Connection.