
Streamlining Automation with Adaptive Cards in Microsoft Teams
Our client is a global leader in sustainable, infinitely recyclable metal and glass packaging, serving brand owners worldwide. Their dedication to…
Client Background
Our client is a global leader in sustainable, infinitely recyclable metal and glass packaging, serving brand owners worldwide. Their dedication to market-leading innovation, quality, and customer service is fueled by continuous investment in their people and processes. With a focus on continuous improvement across all areas of their business, their ensures long-term, sustainable success for their stakeholders. Customer operates around 60 production facilities in 16 countries, employing approximately 20,000 people and generating around $9 billion in sales.
Challenge Description
Building bots using Microsoft’s Power Automate and Desktop Flows addresses numerous automation challenges and enhances overall process efficiency. However, as the complexity of these solutions increases, efficient error handling and debugging become crucial. This is particularly important when managing multiple separate automations and delivering distinct messages to different user groups. For instance, technical and detailed data should be provided to the IT team, while business users may require communication and informational data. So, how can this challenge be effectively addressed?
Answer
While it is common to send emails in such situations, this approach is inefficient for the scenarios described above. An increasing number of notifications from various automations can flood users’ inboxes, causing important messages to be filtered as spam. Even with rules and safety measures in place to ensure notifications reach the inbox, they can easily be overlooked amid more pressing topics. This is where MS Teams Channels and Adaptive Cards excel. Each automation can have a dedicated channel for posting messages based on the type and target group. Using Adaptive Cards for these messages enhances clarity and improves the overall user experience. Additionally, Adaptive Cards feature actionable buttons, enabling navigation to specific places (eliminating the need to search Power Automate monitoring for specific runs) and facilitating communication between users in more complex scenarios.
Components
- Configured target Team and Channel
- Configured connection reference in the automation solution
- Configured action sequence to handle sending an Adaptive Card
Example Scenario
Consider the following situation: you are creating an automation where some steps are completed in Power Automate, and the flow continues in Desktop Flow for completion. This process can be managed in the following steps:
1. Configure Try-Catch Pattern:
- Use Scope actions in your flow.
- The Try block contains all actions, including running Desktop Flow.
- The Catch block includes all error-handling actions and runs only if the Try block does not finish successfully.
2. Filter Action:
- In the Catch block, use the Filter action to get error details from the Try block.
4. Parse JSON Action (Optional):
- Create an object with inputs to the Adaptive Card, such as title, subtitle, descriptions, etc.
5. Compose Action:
- Define your Adaptive Card. Use the designer to visualize its appearance.
- Add filtered errors to this action as a FactSet.
- Add Action.OpenUrl to set up a navigation button to open the failed run in a browser.
6. Post Adaptive Card:
- Use the „Post card in a chat or channel” action with a predefined Team and Channel.
- Set up a connection using the connection reference for easier management during deployment.
In the screenshots below, you can see exemplary flow, designed according to principles described above.
Result of failed run is displayed in the form of the Adaptive Card shown below:
Conclusion
Implementing the described pattern makes flow management and error handling significantly more efficient and transparent compared to an email notifications-based approach. Separate teams and channels help differentiate between projects, making it easier to quickly find and resolve issues. By leveraging MS Teams Channels and Adaptive Cards, you can create a more organized and responsive automation environment.
Using Adaptive Cards within MS Teams channels not only streamlines the communication process but also enhances the overall effectiveness of your automation solutions. This approach ensures that critical information reaches the right users in a timely and manageable way.

