Hi,
I'm exploring Copilot studio and wanted to implement a very simple use case. The user provides input and the bot should uses it to query an API. These are the steps I have in mind:
- Ask the user for input
- User provides input
- Call HTTP API using input as query parameter and save response in variable
- Since there will be multiple matches, which are represented in the response JSON as objects with id and displayName in an array show an Adaptive Card with the results and a "Select" button which then returns the selected "id" of the element.
- Call HTTP API with the selected id to retrieve specific information
- Render the response as a detailed Adaptive Card for that element
Up to step 3 everything is very straight forward. I get my response and can also just log it out, by having a message which has the variable as input. I have also designed an adaptive card that can map data from the API response and it looks fine in Preview Mode.
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "Search Results",
"weight": "bolder",
"size": "medium"
},
{
"type": "Container",
"items": [
{
"$data": "${suggestions}",
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "${type}",
"weight": "Bolder"
},
{
"type": "TextBlock",
"text": "${displayName}"
},
{
"type": "ActionSet",
"actions": [
{
"type": "Action.Submit",
"title": "Select",
"style": "positive"
}
]
}
],
"id": "${type}",
"$when": "${type == \"Application\"}"
}
],
"$data": "${data}"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.3"
}
However, in the "Ask with Adaptive Card" node I can provide my JSON, but there seems to be no way to tell it to bind to my variable that holds the API response so that it can resolve the ${displayName} etc.
What am I missing?