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 7th action which is available is the Delete record (V3) one which will delete records in Business Central.
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 Delete 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 which has to be manually typed as a custom value; in this example, I have used customers.
- Row id is the unique identifier for the record to be read. 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. In the Dynamic content,
System Id
is available which contains this id
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 then the table name can be selected from a drop down list, but you then risk deleting a record from the wrong company.
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.