web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

How to add Attachment to PurchaseInvoice from Power automate

(0) ShareShare
ReportReport
Posted on by 15

Hello!

I have created a power automate flow that is triggered from a new file in OneDrive folder. The flow adds a PurchaseInvoice and an Attachment and then tries to update the attachment content to the created Attachment. 

Could someone help with what to put in the attachmentContent field?

If I leave the field blank, everything works but ofcourse the attachment in business central is empty. I have tried several ways to get the actual file in the field but every time I get Http 400 error BadRequest Invalid Request Body.

Below is my flow and Im using the Update Record (V3) action.

Thanks!

pastedimage1647069897263v1.png

I have the same question (0)
  • JAngle Profile Picture
    133 on at

    You need an extra OneDrive action. “Get File Content”. Use the ID value from the 1st OneDrive action. In the last BC step you can assign the file content from OneDrive. Data should already be a blob so no need to convert from base64

  • JAngle Profile Picture
    133 on at

    Please consider that despite being called “Attachments” the document will actually appear in the “Incoming Documents” area of BC

  • ExAten Profile Picture
    15 on at

    Thanks for the help but still no luck. Now my flow looks like this and the File content in the last step is from the Get File Content action. Any advice?

    pastedimage1647080839045v1.png

  • Suggested answer
    JAngle Profile Picture
    133 on at

    A working method is to not use the BC connector. Use the http connector instead. Majority of this blog will then help you: joshanglesea.wordpress.com/.../

    There is another one on my site to cater for using oauth to authenticate the database.

    Final patch step should be roughly like this:

    4940786B_2D00_34BE_2D00_4033_2D00_BA72_2D00_04164DCAED0F.jpeg

    For If-match you can use *

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,116

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 764 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 635 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans