This article is part of the In Microsoft Dynamics 365 Business Central (Power Automate Actions), how do I… series, a sub-series of the In Microsoft Dynamics 365 Business Central (Power Automate), how do I… series and of the wider In Microsoft Dynamics 365 Business Central, how do I… series which I am posting as I familiarise myself with Microsoft Dynamics 365 Business Central.
There are a number of actions available in Power Automate for Business Central which allow specific actions against the data of Business Central to be performed from within Power Automate.
The 12th action which is available is the Update an image, file or document (V3) one which allows you to update (but not insert) an image, file or document in Business Central. To insert a new image, file or document, you will need to use the Create record V3 action to create the file first and the use this update action to upload the actual image, file or document.
Within a flow, click the add action button; search for Business Central and select the Business Central icon (make sure you select the SaaS one, which is a dark colour instead of the on-premises one which is mainly white):
Find and select the Update an image, file or document V3 action:
There are a few parameters for this action which need to be populated:
- Environment which is set to use the variable populated by the trigger.
- Company which is set to use the variable populated by the trigger.
- API category will default to
v2.0
which is the main API available, but there are others to select from, such as a workflow one, which have different tables available. - Path of the table from which you want to read the record; in this example, I have an going to insert a PDF attachment against a vendor, so the path is
vendors/documentAttachments/attachmentContent
. - pathParameters which needs to be populated with JSON for the keys and content to be updated. In this example, I am updating vendors and related document attachment; if the JSON is malformed or incorrect (such as wrong fields name or value) the step will fail.
As with some of the other actions, when you’re following best practice of using the environment and company variables, rather than hard-coding, the parameters and JSON all need to be populated manually. I typically find it best to create the action first with hard-coded parameters so I can get things like the path and names of the elements for the JSON:
In Microsoft Dynamics 365 Business Central, how do I…
In Microsoft Dynamics 365 Business Central (Power Automate), how do I…
What should we write about next?
If there is a topic which fits the typical ones of this site, which you would like to see me write about, please use the form, below, to submit your idea.