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 9th action which is available is the Run action (V3) one which allows you to run actions against records in Business Central, including posting journals, receiving and invoicing purchase orders, posting sales invoices and more.
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 record 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. - Action name of the action of which you want to run; in this example, I have used journal-post. If you are following best practice for the environment and company, then the actions drop down won’t display and will need to be entered manually. I usually configure it with the environment and company selected from the list to find out the action I want and then set the environment and company to the variables.
- Parameters list is the list of parameters to use which includes the unique identifier “id” for the record to have the action run against it; it needs to be entered as valid JSON, otherwise the faction and flow will fail. It has to be noted, that this is not the code or number, but a GUID identifier, so you do need to supply the id. I would usually use the Find one record V3 to select the record.
The above example, is using what I would describe as best practice of using the trigger variables for environment and name; this is best practice as it ensures that the action is being performed against the same environment and company as the trigger was initiated. In a For a Selected Record V3 trigger, the environment and company are optional, meaning the flow can be set to be triggered from any environment or company, so hard coding an action could result in actions being run in the wrong company.
If you don’t follow best practice for the environment and company, then the Parameters list will not be shown; instead you would populate the id field:
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.