---
id: post/aardvarklabs-blog/3704
type: post
title: Push Documents from Business Central to SFTP via Power Automate
summary: This post demonstrates how to push a Sales Invoice PDF from Business Central to an SFTP site whenever an invoice is posted, using a staging table, a custom codeunit that subscribes to posting events, and a Power Automate workflow to handle the file transfer and status updates.
tier: community
language: en
tags:
  - power automate
  - sftp
  - business events
  - document handling
  - blob storage
  - api pages
system: integration
review:
  state: reviewed
  by: opus
  at: "2026-10-08T01:54:29.905Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-post: 1
  input_hash: a38d8836451662a0ce71f8c99f6742c2e2b3853af75ef58d4e01cc9e20d32170
evidence:
  - kind: blog
    url: https://aardvarklabs.blog/2026/07/10/push-documents-from-business-central-to-sftp-via-power-automate/
    title: Push Documents from Business Central to SFTP via Power Automate
    date: "2026-07-10"
    commit: null
    t: null
    quote: null
  - kind: blog
    url: https://aardvarklabs.blog/2026/07/10/push-documents-from-business-central-to-sftp-via-power-automate/
    title: Push Documents from Business Central to SFTP via Power Automate
    date: "2026-07-10"
    commit: null
    t: null
    quote: For this to work neatly and allow for retries and other advanced management tools we are going to start with a staging table.
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
post_id: "3704"
source_id: aardvarklabs-blog
source_name: Aardvark Labs
url: https://aardvarklabs.blog/2026/07/10/push-documents-from-business-central-to-sftp-via-power-automate/
published_at: "2026-07-10T12:00:00.000Z"
author: Marcel Chabot
full_text: false
words: 1425
quotes:
  - text: For this to work neatly and allow for retries and other advanced management tools we are going to start with a staging table.
    why_it_matters: Explains the architectural choice to use an intermediate table, providing resilience and visibility into the transfer process rather than direct posting.
code_objects_mentioned:
  - table ARD_PAFTPSend
  - page ARD_PAFileStaging
  - api ARD_PAFileStagingAPI
  - codeunit ARD_PAFTPSend
  - other ARD_ReportLayouts
systems:
  - integration
  - sales
  - development
versions_mentioned: []
preview:
  embeddable: true
  frame_url: https://aardvarklabs.blog/2026/07/10/push-documents-from-business-central-to-sftp-via-power-automate/embed/
  image: https://i0.wp.com/aardvarklabs.blog/wp-content/uploads/2026/06/copilot_20260630_212357.png?fit=1200%2C800&ssl=1
  image_alt: null
  image_w: 1200
  image_h: 800
  site_name: Aardvark Labs
  favicon: https://aardvarklabs.blog/wp-content/uploads/2024/04/design-1.png?w=32
  probed_at: "2026-10-07T11:50:24.052Z"
---

# Push Documents from Business Central to SFTP via Power Automate

[Read the post](https://aardvarklabs.blog/2026/07/10/push-documents-from-business-central-to-sftp-via-power-automate/) · Aardvark Labs (Marcel Chabot) · 2026-07-10 · 1425 words · tier community · reviewed (checked by Opus)

> This post demonstrates how to push a Sales Invoice PDF from Business Central to an SFTP site whenever an invoice is posted, using a staging table, a custom codeunit that subscribes to posting events, and a Power Automate workflow to handle the file transfer and status updates.

## Key points

- A staging table (ARD_PAFTPSend) stores invoice files as blobs and tracks whether they have been sent to SFTP
- The codeunit subscribes to the OnAfterPostSalesDoc event, generates the invoice as a PDF, and fires a business event when ready
- Report parameters are extracted as XML and parameterized to enable dynamic report generation with the invoice number
- Power Automate listens for the business event, retrieves the file and metadata from the staging table, uploads to SFTP, and updates the staging record
- The pattern supports retries, failed transfers can be retried by re-firing the business event, and alternative endpoints like SharePoint or network storage can replace SFTP

## Quotes

- "For this to work neatly and allow for retries and other advanced management tools we are going to start with a staging table." (Explains the architectural choice to use an intermediate table, providing resilience and visibility into the transfer process rather than direct posting.)

## AL objects mentioned

As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.

- table "ARD_PAFTPSend"
- page "ARD_PAFileStaging"
- api "ARD_PAFileStagingAPI"
- codeunit "ARD_PAFTPSend"
- other "ARD_ReportLayouts"

Not found in BC28-30: table "ARD_PAFTPSend", page "ARD_PAFileStaging", codeunit "ARD_PAFTPSend".

## Context

- Features: staging table for file uploads, business events, Power Automate integration, API pages, report parameter extraction, blob field storage, file status tracking, retry capability

Source: Aardvark Labs, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.
