Adaptive Card Approvals in Outlook - Part 1
Adaptive Cards are transforming how we create interactive, actionable messages in Outlook, and I’m kicking off a multi-part series exploring how they can integrate with the Power Automate approvals process. In this first post, I’ll walk you through the process of setting up an Adaptive Card in Outlook using Power Automate, from building the card and configuring your flow to registering it with the Actionable Email Developer Dashboard. Along the way, I’ll cover key insights, including why testing on yourself can be misleading and how to avoid common pitfalls that could trip up your automation.
This is just the beginning! In the upcoming posts, I’ll dive deeper into how Adaptive Cards can work seamlessly with Power Automate’s built-in approval system and how you can dynamically create new Adaptive Cards when users are reassigned. Stay tuned as I break down how to streamline your Outlook workflows with powerful automation!
Step 1: Create a Card Response Power Automate Flow
The first step is to create a Power Automate Flow that will handle the response when a user interacts with the Adaptive Card.
Create a new flow with the trigger "When an HTTP request is received."
Set the trigger's security: In the "Who can trigger this flow?" setting, select Anyone to ensure it can be accessed from Outlook.
Define the Request Body Schema: Insert the schema that represents the data you expect the card to send to the flow upon user interaction.
Add a Compose action: This will capture the incoming data for logging and debugging.
Save the flow: Once saved, copy the HTTP POST URL generated and store it in an easily accessible location (such as Notepad) for later use.
Step 2: Register with the Actionable Email Developer Dashboard
To send Adaptive Cards via email, you must register your integration with Microsoft Outlook
Go to the Actionable Email Developer Dashboard: https://outlook.office.com/connectors/oam/publish
Create a new provider:
Select the scope of submission and submit the request for approval.
Copy the Originator ID once approval is granted and save it alongside your flow's HTTP address for future reference.
Step 3: Design Your Adaptive Card
Now that your flow and provider are set up, it’s time to design your Adaptive Card.
Go to the Adaptive Card Designer: https://adaptivecards.io/designer/
Select the host app as Outlook Actionable Messages.
Use templates: There are multiple templates available that you can modify to fit your needs.
Add an Action Set: Set the action type to Action.Http. Use the HTTP POST URL from the response flow, and Headers Shown Below
Body: Include the data to send back to the flow. If using text input from the card, reference it using its ID, e.g., "ApproveCommentID": "{{ApproveCommentID.value}}".
Step 4: Trigger Adaptive Card from a Flow
Now, create another Power Automate Flow that sends the Adaptive Card when triggered by an event, such as a new SharePoint item being created.
Create a new flow triggered by an event, such as "When a new item is created" in SharePoint.
Copy the Adaptive Card payload from the Designer Payload Editor and paste it into a Compose action.
Modify the payload: to include the below header substituting the Originator value for your own.
Dynamically replace placeholders with event-related values.
{ "type": "AdaptiveCard", "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "version": "1.0", "originator": "000e7af3-xxx-xxxxxxxxxxxxx" }
Step 5: Format the Adaptive Card for Email
To embed the Adaptive Card in an email:
Create a new Compose action.
Wrap the Adaptive Card JSON in a script tag:
<script type="application/adaptivecard+json"> {AdaptiveCard_JSON_Body} </script>
Step 6: Send the Email with the Adaptive Card
Add the "Send an email (V2)" action.
Insert the formatted Adaptive Card in the email body.
Ensure recipients are authorized to interact with the card.
Step 7: Process the Card Response
Return to the Card Response Flow to handle the user's interaction.
Ensure the incoming data format matches the expected JSON Schema.
Process the response: Take any necessary actions based on user input.
Compose a response to send back to the Adaptive Card. Sample Code below
{ "type": "AdaptiveCard", "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "version": "1.0", "originator": "000e7af3-xxxxxxxxxxxxxxx", "body": [ { "type": "TextBlock", "text": "You have @{triggerBody()?['Type']} item @{outputs('Get_item')?['body/Title']}", "wrap": true, "horizontalAlignment": "Left", "size": "Small" } ] }
Step 8: Send a Response to Update the Card
Add a "Response" action in Power Automate.
Configure the response: as Shown below
Conclusion
With these steps completed, you now have a fully functional Adaptive Card workflow in Outlook. Users can interact with the card, trigger a Power Automate flow, and receive real-time updates.
Several issues to be aware of when creating these cards:
If you test the card by sending it to yourself, it will always appear correct—even if something is incorrectly configured in the Approval Dashboard. Always test it with another user to ensure it works as expected.
This solution only works in Outlook and does not function with other web services.
In the next blog post, we will explore how to replace the default Power Automate Approval process with an Adaptive Card to enhance your approval workflows.
Stay tuned for the next installment in this series!