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

  • Suggested answer
    JAngle Profile Picture
    83 on at
    RE: How to add Attachment to PurchaseInvoice from Power automate

    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 *

  • ExAten Profile Picture
    15 on at
    RE: How to add Attachment to PurchaseInvoice from Power automate

    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

  • JAngle Profile Picture
    83 on at
    RE: How to add Attachment to PurchaseInvoice from Power automate

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

  • JAngle Profile Picture
    83 on at
    RE: How to add Attachment to PurchaseInvoice from Power automate

    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

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,269 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,017 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans