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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Business Central attac...
Power Automate
Unanswered

Business Central attachments connector error

(0) ShareShare
ReportReport
Posted on by 17

Done this in a few ways but get the same error at the end, which is: ErrorCode: BadRequest Read called with an open stream or textreader. Please close any open streams or text readers before calling Read.

 

JAngle_0-1606745937801.png

Whether I use the manual button and just pick a file or if I select something from an outlook email or onedrive/sharepoint I get the same error message. These are the parameters passed to the connector:

JAngle_1-1606746042364.png

 

Categories:
I have the same question (0)
  • murshed Profile Picture
    Microsoft Employee on at

    Hi @JAngle 

    It appears that the File Content is a stream that is open during the flow run. Create Record most likely is complaining about it. Although I am not sure it will work, try saving the File Content to a variable and save the variable to Business Central. Also try using the File System connector to get the file content instead of manual trigger. If you are planning to save your attachment, consider copying file to One Drive or Azure Storage and add a link/id to the file/blob in Business Central. Please let us know more about your workflow for me to provide more specific help.

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION ☑️. If you find this reply helpful, please consider giving it a LIKE 👍.

  • JAngle Profile Picture
    37 on at

    Will try the suggested approach. Feels like it should be similar to the following but only Business Central is different. The strange part is that if you use the mentioned endpoint outside of the defined connector you need to add more information as the attachment has to be assigned to a related record. Like the idea of Power Automate being more sophisticated but I’m dubious as to why that would be?

     

    Similar concept:

    https://powerusers.microsoft.com/t5/Building-Flows/Update-Excel-Spreadsheet-from-email-attachment/td-p/193186

     

    API:

    https://docs.microsoft.com/en-us/dynamics-nav/api-reference/v1.0/api/dynamics_attachment_create

     

  • JAngle Profile Picture
    17 on at

    Tried saving as a variable, in onedrive, in sharepoint and on file system. All result in the same error on the business central connector 🤷‍♂️

  • JAngle Profile Picture
    37 on at

    Had more joy with the standard api of BC using the http connector: https://joshanglesea.wordpress.com/2021/01/25/business-central-attachments-with-standard-api-part-1-basic-explanation/

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard