Being able to attach documents to Microsoft Dynamics 365 Business Central records using Microsoft Power Automate provides you with more software design options. You can attach documents to Business Central records using workflows based upon triggers or embed your document workflow into a real-time Microsoft Power App. The possibilities are limitless.
Let's look at an example of how you can attach an order confirmation document to a Business Central sales order using Power Automate.
1. Go to My Flows under Power Automate and click on Instant cloud flow.
2. Enter your flow name and click on Manually trigger a flow. Then press the Create button.
3. For this example I am using a document stored on Microsoft OneDrive. Insert a OneDrive for Business / Get File Content step. Select the file that will be attached.
4. Next we need to select a Business Central sales order. Insert a Dynamics 365 Business Central / Get Record step. I used a GUID from an existing sales order as the Row id.
5. Add a Business Central / Create Record step that will create a record in the documentAttachments table. Make sure to enter the Parent Type as Sales_x0020_Order and use the Id from the sales order for the Parent Id.
6. For our last step we will add a Business Central / Update an image, file or document step. This step will attach the document content to the documentAttachments record that we created in the last step. Enter the Id from the documentAttachments record and select the Body from the retrieved document in the Content field.
We are done. This workflow will now attach your file to the Business Central sales order.