BC AL Journey #14
One of the most capable things within Business Central is the ability to interact with the Power Platform, and in this case specifically Power Automate. Working with the Business Central Connector for Power Platform grants you access to hundreds of automation capabilities.
Power Automate, as well as it’s Azure hosted brother Logic Apps, is an entirely different paradigm in Software Development. We will be starting simple with a template, but we will be building on this technology later.
Just because we are leaving Business Central AL code behind for this one, doesn’t mean we are leaving behind the requirements process.
Use Case
User would like to generate a Teams notification when a customer is Blocked.
Implementation
- Create a Power Automate flow that adds a message to a Teams chat when the Hold flag is set on a customer.
Test Plan
- Place a customer record on Hold, verify Teams Message.
If you have been developing in a Docker or other non-SaaS instance of Business Central, you will need to move to a SaaS instance for this.
I’m starting on a customer record and going to the “Automate” menu and selecting “Power Automate”.

Here we have three different starting points:
- Create approval flow
- Create automated flow
- Create action based on a flow
An Approval flow create a process which sets the record into an unapproved state, then allows you to send notifications and request approval.
An Automated flow runs based on data events on the record. There are many built in Business Events that are commonly used, we can and will create our own Business Events later.
An Action based on a flow adds a button that the user can click that will immediately trigger a flow to run.
There is an existing Business Event for when a customer is blocked, and a supporting template for that specific event. As this is the first trek into this tool set, we are going for easy mode.
Clicking on “Create automated flow” brings up a new menu.

Clicking the “Notify on Teams when a customer is blocked in Business Central” box leads us the next prompt window.

The Power Automate flow is going to need to connect to Business Central and Teams. Here is where we supply those credentials. Often this is already populated with the current users’ credentials. Click “Next” when everything looks good.
Next, we must connect to a Team and a Channel to post the message.

Click “Create flow” to start the magic.

If we look inside Power Automate, we can see our new flow.

When we change a customer’s Blocked status:

We get a message in Teams:

Success!
We can look inside the Power Automate flow from inside make.powerautomate.com
The entire flow is only four blocks long, but there is some really interesting technology inside these blocks.

The first block is what connects to Business Central and receives the Business Event when the customer is blocked. Editing that block you can see that there are several additional Business Events available.


The next block is a Business Central Adaptive Card. Adaptive Cards are a technology that allows you to create interactive HTML elements that can be sent to Teams, Emails, Chatbots, all sorts of technologies. In this case Business Central provides the Adaptive Card, but later we will learn to create our own.

The stock title of the Adaptive Card isn’t what we want in teams. Adaptive Cards are HTML which can be edited as a text element and stored in a variable.


Lastly, we send a Teams message with the updated Adaptive Card body that we edited.


In this example we let the template and the wizard do all the work for us. This gave us a nice working example to poke around and look under the hood. Next, we will go back to some of the work we did in BC AL Journey #11 and create our own Business Event and a custom Power Automate Flow.





Leave a comment