Handling Business Central approvals in Teams and adaptive cards

After watching the Microsoft Flow Conference this year prepared by Jon Levesque alongside a lot of people giving conferences I decided to put to the test one of the features I really liked in there: the integration with teams using the adaptive card connector in Flow. In my case, with Business Central and the approvals process in it which is something I enjoy 🙂

Using Microsoft Teams to handle Business Central approvals is way easier and quicker than using e-mails

So as you might have guessed, this solution uses Dynamics 365 Business Central, Microsoft Teams and Microsoft Flow. Something to keep in mind, if you are using Business Central in SaaS, chances are you also have Office365 (with Microsoft Teams), and access to the PowerPlatform (for Flow).

At the time of this post, the licensing method is seeing a lot of changes so make sure everything is in order first.

So to put in motion Business Central Approvals in Microsoft Teams, first we need to set up a simple approvals set up in Business Central. To do this we can go the “Approval User Setup” window and set a first user who will be the approver called “ADMIN”, and another user who will request the approval called “PROVES” in my case.

ADMIN will approve or refuse PROVES requests

Once we have Business Central set up, we can go straight into flow.

Microsoft is doing a great job with the Flow templates, we can learn a lot from the already defined templates.

There is a Flow Template that handles the approval requests using Flow’s approval. In our case we’ll use Business Central approval’s system and Teams to accept and/or refuse instead.

To use flow, we go to Flow’s page and create a new one. It is important that we do so with a management/high permission account in Business Central preferibly. This flow will need the permission to approve the request in behalf of someone else, so it needs to be able to (check the Approval User Setup window again if need to).

Our flow looks like this:

General view

Business Central starts the flow with its trigger. In this case I filter the requests for documents that have an amount higher than 1000 and the status is open.

After that I get the salesOrder from Business Central because that way we can use the dynamic information provided by the connector in future steps of the flow.

After that, we use Teams connector to show a message to a user using the Flow bot. The recipient you can either retrieve from Business Central or enter manually in the flow, which can be easier in smaller/easier companies.

In this step, we add two options for the approver, “Approve” or “Refuse”. That will generate an adaptive card with the Headline, Message and options defined in this flow step.

After that, we handle the answer from the approver.

In case it is approved, the approver gets a message confirming the response in Teams, the document is approved in Business Central and then the person who requested it originally gets a confirmation in their Teams message board from the Flow Bot.

In case the approver refuses the request, the approver gets a confirmation of his/her decision, the document is refused in Business Central and then it is communicated to the person who requested the approval in the first place in Teams.

Let’s see how it looks once the flow runs from the approver’s point of view.

First the person launches the request
Microsoft Teams receiving a Flow notification

Teams of the approver recieves a new chat box from the Flow bot.

Microsoft Teams Flow approval adaptive card

Once we open the chat we have this information and options: Approve and Refuse. The approver can put a comment in the box if need be. Once he/she submits it a confirmation message is sent.

The confirmation message sent using Flow bot

And of course, Business Central gets the approval and changes the status to Released.

Status of the Sales Order in Business Central after approval.

And this is how you can handle Business Central Approvals in Microsoft Teams. What do you think of this use of the adaptive cards in Teams? Does it look like something you can use in your system? Let me know below.

Want to learn more about BC? You can check the blog!

Leave a Reply

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