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

Community site session details

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

Saving an attachment to business central from Power Automate or Power Apps

(0) ShareShare
ReportReport
Posted on by 130

Hi All,

I came across JAngle 's blog on attachments in BC using HTTP / POST - and came across comments referring to new BC media/image connector.

Seen here - https://learn.microsoft.com/en-us/dynamics365-release-plan/2022wave2/smb/dynamics365-business-central/add-mediaimage-support-business-central-connectors - but I genuinely don't know how to implement it:

I would like to:

  • Have user upload attachment into power app
  • import that image into BC - associated with a new record (could save to factbox attachment - or in record if possible)

Any thoughts on how I could achieve this?

Thank you

I have the same question (0)
  • SammySevens Profile Picture
    130 on at
    RE: Saving an attachment to business central from Power Automate or Power Apps

    Hi yzhums - am I able to follow your procedure for picture in list view? Or is it only applicable for card view?

    I can not get it to work in list view (as shown above...)

    Thank you in advance for suggestions

  • SammySevens Profile Picture
    130 on at
    RE: Saving an attachment to business central from Power Automate or Power Apps

    Hi Zhu,

    I think I'm close....

    • I tested many times and I can save the image from powerapps to sharepoint, and also send as attachment in email (this tells me the image file is "working" in power automate)
    • The flow below runs successfully - but the image does not appear in factbox on right hand side of record in custom table

    Any thoughts? It's almost there!

    pastedimage1679003088642v3.png

    pastedimage1679003122574v4.png

  • Suggested answer
    YUN ZHU Profile Picture
    92,161 Super User 2025 Season 2 on at
    RE: Saving an attachment to business central from Power Automate or Power Apps

    Hi, I did a simple test before, hope it can give you some hints.

    Business Central 2022 wave 2 (BC21) new features: Power Apps and Power Automate support for media/image & document attachments

    https://yzhums.com/33436/

    Thanks.

    ZHU

  • Suggested answer
    Nitin Verma Profile Picture
    21,666 Moderator on at
    RE: Saving an attachment to business central from Power Automate or Power Apps

    Hi,

    You can refer the below link to save the file in sharepoint or you can directly write your BC code to save file into Blob storage.

    www.navwithnav.com/.../

    rishonapowerplatform.com/.../

  • SammySevens Profile Picture
    130 on at
    RE: Saving an attachment to business central from Power Automate or Power Apps

    Thank you for this link Inge, this is very insightful, and great question....here is what I would like to happen:

    • On a power app - a user uploads an attachment from their phone to a field in either the custom Requests table, or Incoming Documents table (most likely .jpg)
    • The user submits the power-app form request and image field is stored either in Requests, or Incoming Documents
    • A BC user will open a page for the Requests table, and view a line record where the attachment is either:
      • A value in a column (int: 1/2/3 etc) 
      • Factbox attachment
      • A link to the attachment
      • Something else?

    Regarding REST

    • Do I POST (from power automate) to the Requests Table, or Incoming Documents table? 
    • In power automate - do I need to store the uploaded image in a location (like onedrive) and then POST to Business Central table (using commands here, and pasted below?)

    {
        "parentId" : "0a077d18-45e3-ea11-bb43-000d3a2feca1",
        "fileName": "myPDF.pdf",
        "parentType": "Journal"
    }
    
    ParentId is the Id of the entity, for which an attachment is being created.
    
    **Response**
    
    ```json
    HTTP/1.1 201 Created
    Content-type: application/json
    
    {
        "id": "b282a6f1-bfe3-ea11-aa60-000d3ad7cacb",
        "parentId": "0a077d18-45e3-ea11-bb43-000d3a2feca1",
        "fileName": "myPDF.pdf",
        "byteSize": 0,
        "lastModifiedDateTime": "2020-08-21T15:06:53Z",
        "parentType": "Journal"
    }

    Thank you for your insight here!

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,037 Moderator on at
    RE: Saving an attachment to business central from Power Automate or Power Apps

    To what data items in Business Central do you want to use the attachements ?

    Many of the standard API's already have support for attachement. Here is an example for the purchase orders in combination with incoming documents.

    learn.microsoft.com/.../dynamics_purchaseorder

  • SammySevens Profile Picture
    130 on at
    RE: Saving an attachment to business central from Power Automate or Power Apps

    Thanks Daniele for this overview.

    Few questions:

    • What is binary image field? Is it of type media in BC?
    • Can the custom table in BC include other fields i am using for my powerapp? (i already have one)
    • Using HTTP connector - i should post the powerapp image using power automate to the api location? Is the API pointing to custom table?

    I am decent in AL programming, not much powerapps/power automate, but think i can do this!

  • Suggested answer
    DAnny3211 Profile Picture
    11,369 on at
    RE: Saving an attachment to business central from Power Automate or Power Apps

    hi

    the new Business Central media/image connector can be used to achieve this. Here are the general steps to implement this:

    Create a custom table in Business Central to store the uploaded images and associate them with the desired record. This table should have a field for the image file itself (in binary format) and a field to store the unique identifier of the associated record (e.g. Sales Order No., Purchase Order No., etc.).

    Create a custom API in Business Central that allows you to create a new record in the custom table and upload an image file to it. This API should take in the unique identifier of the associated record, along with the image file in binary format, and create a new record in the custom table with the image file attached.

    In your Power App, use the HTTP connector to call the custom API in Business Central and pass in the unique identifier and binary data of the uploaded image.

    Upon successful execution of the API, the uploaded image will be stored as an attachment in the custom table in Business Central, associated with the desired record.

    Please note that the above steps are high-level and require some technical knowledge of Business Central development and Power Apps

    DAniele

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 3,885

#2
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 3,405

#3
Sumit Singh Profile Picture

Sumit Singh 2,837

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans