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 6th action which is available is the Create record (V3) one which allows you to create new records in Business Central from a Power Automate flow.
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 Create 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. - Table name of the table from which you want to read the record and must be manually typed; in this example, I have used customers.
- Row which needs to be populated with JSON for the fields to be updated. In this example, I am setting the number, name and address fields; if the JSON is malformed or incorrect (such as wrong fields name or value) the step will fail.
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 data being created in the wrong company.
If you select the environment and company, instead of using the trigger variables, then the Row field is not displayed; instead you see a long list of fields into which you can populate the data:
In both cases you will successfully create a record, but while the first method is more complex to create, it does mean the correct company will have the records created.
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.