Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
This article describes features used in agents or agent flows powered by the standard harness.
Use an Adaptive Card to collect information from a user during an agent conversation. A card can contain text, graphics, buttons, and input fields. Learn more in Use Adaptive Cards in Copilot Studio.
With an Adaptive Card node, your agent can show an Adaptive Card containing one or more submit buttons, and optionally, one or more form input fields. Your agent stores user input in variables for use later in the conversation.
Note
Copilot Studio supports the Adaptive Cards schema versions 1.6 and earlier. However, the appropriate schema version depends on the targeted host app:
- The Bot Framework Web Chat component (that is, the default website integration pattern) supports version 1.6 but doesn't support
Action.Execute - The live chat widget (used for Omnichannel for Customer Service) is limited to version 1.5
- Teams is also limited to version 1.5
In addition, Copilot Studio only renders version-1.6 cards in the test chat, not on the canvas.
Learn more in AdaptiveCard.
Copilot Studio includes a built-in Adaptive Card designer, which offers the most useful features from the Adaptive Cards Designer.
Alternatively, you can:
- Use a JSON representation for the card you want to show to the user.
- Use a Power Fx formula to include dynamic information on the card.
You can also control the behavior of the card, such as what to do when the user enters an invalid response or if the node can be interrupted.
The Adaptive Card node is meant for interactive cards, where the user is expected to submit a response. Use Message and Question nodes to present the user with a noninteractive card that displays information.
Tip
Rename nodes to make them easier to identify. Select the node's name field to update the name directly, or select the three dots (…) of the node and select Rename from the menu. You can also rename nodes in the code editor.
It's not possible to rename Trigger nodes and Go to step nodes.
Node names can be up to 500 characters in length.
Add an Adaptive Card node
Select the Add node icon
under the node after which you want to add an Adaptive Card node. Then select Ask with Adaptive Card.Select the three dots (…) of the node, and then select Properties.
In the Adaptive Card node properties panel, select Edit adaptive card. The Adaptive card designer panel opens.
Add the desired elements for your card and configure their properties. Alternatively, in the Card payload editor pane, replace the default payload with the JSON literal for your card.
Tip
Your card must contain at least one submit button, as it must be an interactive card that allows a user to submit information back to the agent. If it doesn't and is only intended to show information, you should add your Adaptive Card to a Message node.
When you're done with the initial design, select Save and close the designer panel. A preview of your card appears on the node. Copilot Studio automatically creates output variables based on the inputs specified in the code.
Tip
If the output variables generated for your card are incorrect, you can manually update the list of variables and their types by selecting Edit Schema in the Adaptive Card node properties panel.
Your interactive Adaptive Card is ready. When a user of your agent selects a submit button on a card, the output variables are populated with the information the user provided in their interaction with the card.
Other properties
Use the other properties to control the behavior of the Adaptive Card node, such as:
- How the agent responds to an invalid response
- If it can be interrupted
If the agent is awaiting a submission from an Adaptive Card and the user sends a text message instead, this response is considered invalid, unless the message triggers an interruption. In this case, the following properties determine the behavior.
How many reprompts: The number of times your agent tries to get a valid submission from the card. The default is Repeat up to 2 times. You can also select Repeat once or Don't repeat. For each retry, the card is resent to the user.
Retry prompt: Use this property to define a message to send when a retry occurs, along with a repeat of the card. To define a retry message, select Customize and then enter the new prompt.
Allow switching to another topic: If selected (default), an incoming message from a user when the agent is awaiting a card submission triggers an interruption and switches to another topic. If a topic switch occurs, the card is sent again to the user once the interrupting topic ends.
Submit button behavior for agents with consecutive cards
By design, Adaptive Cards allow selecting their submit buttons multiple times. If an agent has consecutive Adaptive Cards, and the user selects a button on an earlier card, the user might experience unexpected behavior.
To distinguish submissions from different cards, include identifying data in each submit action and check it when processing the response. In a custom client, handle repeated or stale submissions separately from identifying which action was selected.
Use a submit identifier in Action.Submit data
If your agent sends multiple Adaptive Cards in a conversation (for example, consecutive cards, retries, or interruptions), users might select Submit on an earlier card. Include an identifier in each submit action's data payload and validate it when processing the response.
Example:
{
"type": "Action.Submit",
"title": "Confirm",
"data": {
"actionSubmitId": "booking_confirm_card_v3_confirm"
}
}
This fixed identifier distinguishes the action in this example. It doesn't uniquely identify every rendered instance of the card or automatically prevent duplicate submissions.
Web Chat UX tip to avoid stale clicks
Some chat clients keep earlier cards clickable after a user submits a later card. If you build a custom Web Chat experience, consider making submitted cards read-only or updating earlier cards to reduce accidental duplicate or stale submissions.
Use the action-handling and activity-sending interfaces supported by your chosen client. Keep submit handling separate from other card actions, and provide a way to retry when delivery fails. Making a card read-only is a client-side usability measure, not a replacement for validating submissions in your agent or service.
Use Power Fx to make your card dynamic
You can use a Power Fx formula to include dynamic information on your card by referencing variables from your topic or agent.
Select the three dots (…) of the node, and then select Properties.
In the Adaptive Card Node properties panel, switch to Formula. Selecting Formula automatically converts the JSON representation of your card into a Power Fx formula.
For example, start with the following JSON literal for a card:
{ "$schema": "http://adaptivecards.microsoft.com/schemas/adaptive-card.json", "type": "AdaptiveCard", "version": "1.5", "body": [{ "type": "ColumnSet", "columns": [{ "type": "Column", "width": 2, "items": [{ "type": "TextBlock", "text": "Tell us about yourself", "weight": "Bolder", "size": "Medium", "wrap": true, "style": "heading" }, { "type": "TextBlock", "text": "Enter your name to continue with your booking.", "isSubtle": true, "wrap": true }, { "type": "Input.Text", "id": "myName", "label": "Your name", "isRequired": true, "errorMessage": "Please enter your name." } ] } ] } ], "actions": [{ "type": "Action.Submit", "title": "Submit", "data": { "actionSubmitId": "trip_details_submit" } } ] }Here's the resulting Power Fx formula, using two variables Topic.Title and Topic.Subtitle instead of the hard-coded text from the JSON literal. (This example assumes the variables are defined in your topic.)
{ '$schema': "http://adaptivecards.microsoft.com/schemas/adaptive-card.json", type: "AdaptiveCard", version: "1.5", body: [ { type: "ColumnSet", columns: [ { type: "Column", width: 2, items: [ { type: "TextBlock", text: Topic.Title, weight: "Bolder", size: "Medium", wrap: true, style: "heading" }, { type: "TextBlock", text: Topic.Subtitle, isSubtle: true, wrap: true }, { type: "Input.Text", id: "myName", label: "Your name", isRequired: true, errorMessage: "Please enter your name." } ] } ] } ], actions: [ { type: "Action.Submit", title: "Submit", data: { actionSubmitId: "trip_details_submit" } } ] }
Important
Once you begin editing in the formula panel, you can't go back to the original JSON code. To allow iterative design and changes, save a copy of the original JSON in your own notes or as a comment in the node. This precaution helps you revert changes if needed.