Business Central: How to send notifications from Workflows to Teams

Hello, today I want to share a very simple Post, regarding how to send notifications from Business Central Workflows to a Chat or Channel in Teams.

Power Automate

In order to send these notifications, we are going to create a Flow in Power Automate through the following steps:

  1. We click on Create / Automate Cloud Flow
  1. In Flow Name we put the name that represents our Flow, I put it Workflow Sales Approvals and in this step, we look for the correct flow, I select “When a Sales Document Approval is Request V3

Then, in the next window we must fill in the following values:

In my case, these were the ones I used:

  • Environment name: SANDBOX
  • Company name: My Test Company
  • Header first condition: DocumentType
  • Header first condition is: Order
  • Header second condition: Status
  • Header second condition is: Open
  • Header third condition: AmountIncludingVAT
  • Header third condition is: >0

Through the Header Conditions, we can create the conditions that we want our Sales Order to have in order to go through the Workflow process, for example, we could only use it for those Sales Orders with higher amounts such as 10 thousand or 20 thousand dollars for example.

For this demo example, I have simply set greater than zero amounts.

  1. Now, we add the “Get Record V3” Action, in order to be able to obtain the necessary Sales Order information that we will use to send in Teams.

The Environment Name and Company Name must be the same as in the previous step. Now the API Category should be workflowEndpoints and the Table name field should be workflowSalesDocuments

We are now looking for the option “Post Message in Chat or Chanel” of Teams.

And in the window we must fill in the following information:

  • Post as: Flow bot
  • Post in: Channel. We have other options like “Chat with Flow bot” and “Group chat
  • Team: Business Central. Corresponds to the name of our Team created in Teams.
  • Channel: Workflows Notifications. Indicates the name of the Team Channel chosen in the previous field.
  • Message: Sales Order: @{outputs(‘Get_record_(V3)’)?[‘body/number’]} totaling: @{outputs(‘Get_record_(V3)’)?[‘body/amountIncludingVAT’]} and Customer: @{outputs(‘Get_record_(V3)’)?[‘body/sellToCustomerNumber’]} needs to be approved.

To do this Flow, we must have previously created the Team and Channel in Teams.

All together it would look like this:

Business Central

If we look inside Workflows we can see that a new one has been created

If we click on it we can see its detail

On Condition:

Sales Order

Now, if we go to a Sales Order, and send the Approval request:

Teams

Finally, this is how notifications would arrive in Teams.

Conclusion

Thanks to Power Automate, we can easily automate repetitive processes by connecting apps like Business Central and Teams.

I think it is very useful to receive messages of this type in Teams to improve the efficiency of any company’s processes.

There are also templates to carry out this process through emails, but I wanted to do something slightly different.

Finally, I want to leave a similar post, which I did a long time ago to send notifications from Business Central to Telegram.

For more information visit the official Microsoft documentation

I hope this has been helpful.

Leave a Reply

Your email address will not be published. Required fields are marked *