You need to edit the workflow to add an Adaptive Card and post to the
To edit the Workflow for using Adaptive Card, perform the following steps:
-
In the Workflows window, go to the Home tab and click the Flow name to see details.
-
Click Edit to add actions to the workflow.
-
Click
(additional options) to see the options for the step 'Send each adaptive card'.
-
Click Delete to delete the step.
When creating a workflow for a webhook request, the Send Each Adaptive step is automatically added. To correct the workflow, you need to delete this step.
-
Click OK in the confirmation pop-up.
-
Click New step to add further steps in the workflow.
-
-
From the Dynamic content search, select Content type to body.
-
In the Apply to each window, click Parse JSON.
-
In Parse JSON, copy the schema into the Schema field.
You can paste the customized schema, but ensure that it has been tested before pasting here.
Schema
{ "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "text": { "type": "string" }, "wrap": { "type": "boolean" } }, "required": [ "type", "text", "wrap" ] } }
-
Once the Parse JSON is pasted, click Add an action. The Choose an Operation window is displayed.
-
In the Choose an operation window, search and select Post a card in chat or channel.
-
If the version is changed to greater than 1.3, the card is not displayed on the channel.
The selected Target Version (1.6) is greater than the version supported by Bot Framework WebChat (1.3).
You can create custom adaptive cards Designer | Adaptive Cards.
RichTextBlock can recognize the '\n' as a newline character, and TextBlock recognizes '\n\n' as a newline character.In the Post card in a chat or channel step, perform the following steps:
- From the Post in drop-down list, click Channel.
- Select Team ID and Channel ID.
Paste the below Adaptive Card in the Adaptive Card section.Adaptive Card
{ "type": "AdaptiveCard", "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "version": "1.3", "body": [ { "type": "RichTextBlock", "inlines": [ { "type": "TextRun", "text":"@{items('Apply_to_each_2')['text']}" } ] } ] }
- From the Post in drop-down list, click Channel.
- Click the
beside the text to ensure it is selected from the dynamic tab.
To parse the card text content, ensure to replace "@{items('Apply_to_each_2')['text']}" with the 'text' from the Dynamic content in the Teams Workflow.
- Click Save.
Your Workflow is ready to use.