Send Paige documents to Laserfiche with Power Automate
Build the Power Automate flow that watches Paige's SFTP export folder, reads each document's field values, and imports the PDF into Laserfiche Cloud through the Laserfiche API with its template assigned and fields filled — using a service principal, exactly as Laserfiche's own low-code guide describes.
Before you begin
- Laserfiche Cloud, with rights to create a service principal and a Developer Console app
- A Power Automate license that includes premium connectors (SFTP - SSH and HTTP are premium)
- An SFTP server Paige can reach, with a folder for this scan job
- A Paige scan job with document types and fields set up, and a Laserfiche template whose fields you'll fill
At the end of this guide, every document Paige finishes is imported into your Laserfiche Cloud repository within minutes — in the folder you choose, with its template assigned and its fields filled from Paige's values — by a Power Automate flow that calls the Laserfiche API the way Laserfiche's own low-code guide shows.
There is no Laserfiche connector in Power Automate; the flow uses the built-in HTTP action against the Laserfiche Repository API. It's two calls: get a token, then import. The rest of the flow is the usual Paige pattern: SFTP trigger → keep only the data file → Parse JSON → get the PDF → import.
Step 1 — Point Paige at your SFTP server
In Paige, open Settings (the gear at the bottom of the left menu — administrators only), pick the scan job, and choose Export.
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.Click Test Connection. What you should see:
FTP connection successful!Connect —Connected to FTP Server!and a green Connected label.Turn on Enable Auto Export. Under Auto Export Settings, switch on Only documents having a document type, set Auto Field Entry Complete to Yes, and set Human Reviewed to Reviewed if a person checks documents in Paige first. Click Save.
Open port 22 on your firewall to Paige's address ranges — Outbound IP ranges for firewall allow-lists.
Step 2 — Give the flow an identity in Laserfiche
Laserfiche wants integrations to act as a service principal (an unlicensed, non-human user) through a service app.
Create the service principal. In Laserfiche Cloud's Account Administration, open the Users tab and, under Service Principals, click Add Service Principal. Give it a username and display name, grant it access to the repository (a group with import rights on the destination folder is the tidy way), and click Create.
Create a service app. In the Developer Console, click New, choose the Service app type, and on App Configuration select the service principal you just made. Save. Under Authentication, in OAuth 2.0 Scopes, allow
repository.Read repository.Write.Generate the credential the flow will use. In the same app, generate a long-lasting authorization key (Laserfiche's Option 2 for service apps; it lets the flow request tokens with a plain Bearer header instead of signing a JWT). Copy it — it's shown once. Store it in the flow as a secured input, never in plain text.
Note your repository ID (visible in the repository's URL and in Account Administration) and the entry ID of the destination folder (open the folder in the web client; the ID is in the URL).
Step 3 — Build the flow
Create an Automated cloud flow.
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.
Condition: File name ends with
.json. Steps 3–6 go in If yes.
Parse JSON. Content: the trigger's File content; schema generated from a real
.jsonvia Use sample payload to generate schema.
SFTP - SSH: Get file content using path. Path: the folder plus the parsed
pdf_file.
HTTP — get a token. Name the action
Get Laserfiche Access Token.- Method: POST. URI:
https://signin.laserfiche.com/oauth/token(usesignin.laserfiche.caorsignin.eu.laserfiche.comif your account is hosted there). - Headers:
Authorization: Bearer <your authorization key>andContent-Type: application/x-www-form-urlencoded. - Body:
grant_type=client_credentials&scope=repository.ReadWrite. - Turn on Secure Inputs in the action's settings so the key doesn't appear in run history.
- Method: POST. URI:
HTTP — import the document.
Method: POST. URI:
https://api.laserfiche.com/repository/v2/Repositories/<repositoryId>/Entries/<folderEntryId>/Folder/ImportHeaders:
Authorization: Bearer @{body('Get_Laserfiche_Access_Token')['access_token']}and aContent-Type: multipart/form-data; boundary=...header that matches the body.Body: a multipart body with two parts — the PDF from step 4 as the file part (binary), and a JSON part named
request:{ "name": "@{body('Parse_JSON')?['fields']?['Invoice Number']} - @{body('Parse_JSON')?['fields']?['Vendor Name']}", "autoRename": true, "metadata": { "templateName": "Vendor Invoice", "fields": [ { "name": "Vendor", "values": ["@{body('Parse_JSON')?['fields']?['Vendor Name']}"] }, { "name": "Invoice Number", "values": ["@{body('Parse_JSON')?['fields']?['Invoice Number']}"] }, { "name": "Invoice Date", "values": ["@{body('Parse_JSON')?['fields']?['Invoice Date']}"] }, { "name": "Amount", "values": ["@{body('Parse_JSON')?['fields']?['Total']}"] } ] } }templateNameand each fieldnamemust match the Laserfiche template and its field names exactly.autoRenamekeeps a duplicate name from failing the import. Laserfiche's low-code guide shows the exact multipart layout Power Automate accepts — build yours from that example.
What you should see when you test: HTTP
201 Created, and a response whosedocumentLinkpoints at the new entry. Field errors, if any, come back inside the response rather than as a failed request, so check it.
Save. What you should see: the flow checker reports no errors.
Laserfiche date and number fields are particular about format. Paige exports values as text exactly as they appear on the page; convert with formatDateTime() and float(replace(...)) in the expressions above when the template field isn't text.
Step 4 — Test it
Process one document through the scan job in Paige (review it if you required review) and wait for the export.
Open the flow's 28-day run history. What you should see: one successful run; the import action returned
201.In the Laserfiche web client, open the destination folder. What you should see: the document with the template assigned and the fields filled. Open it — the text is selectable.
When it doesn't work
| Symptom | Where to look |
|---|---|
Token request returns 401 | The authorization key is wrong or was revoked, or the scope isn't allowed on the app. |
Import returns 401 or 403 | The service principal lacks rights on the folder, or the token expired between steps (they're short-lived; request a fresh one each run, as the flow does). |
Import returns 400 | The multipart body isn't formed as the API expects, or the JSON request part is invalid. Compare against Laserfiche's low-code example. |
| Document arrives without fields | A field name doesn't match the template, or a value failed the field's type. Read the operations summary in the 201 response. |
| The flow never runs | Wrong SFTP folder, or a subfolder. Files over 50 MB are skipped by this trigger. |
| Nothing arrives from Paige | Auto-export criteria aren't met, or the document 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.
