web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / How to map data to "As...
Copilot Studio
Unanswered

How to map data to "Ask with Adaptive Card" node?

(0) ShareShare
ReportReport
Posted on by 2

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:

 

  1. Ask the user for input
  2. User provides input
  3. Call HTTP API using input as query parameter and save response in variable
  4. 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.
  5. Call HTTP API with the selected id to retrieve specific information
  6. 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?

Categories:
I have the same question (0)
  • fernandosilva Profile Picture
    Super User 2024 Season 1 on at

    Hi @TimJP ,

     

    Have you tried using Power Automate with conditions and call it from the Actions in PVA?

     

    Cheers,

     

    Fernando

  • TimJP Profile Picture
    2 on at

    Hi @fernandosilva ,

    no I haven't. To a beginner it's also not obvious that this might need Power Automate. For something that should be rather common my expectation was that there is an "input" parameter for the "Ask with Adaptive Card" node where I simply select the variable that stores my data. Can you give me some pointers that I can follow to achieve this?

    Thanks,

    Tim

  • fernandosilva Profile Picture
    Super User 2024 Season 1 on at

    Hi @TimJP ,

     

    Below is an adaptive card structure for the latest PVA where you can get any value from the inputs and save in a variable inside PVA and create a condition inside PVA.  So, instead on PA, you can use just PVA.

     

    Just in case you need to send the data to someone else, you will need Power Automate.

     

    Cheers

     

     

    {
     "type": "AdaptiveCard",
     "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
     "version": "1.0",
     "body": [
     {
     "type": "TextBlock",
     "size": "medium",
     "weight": "bolder",
     "text": "General Enquiry",
     "horizontalAlignment": "center",
     "wrap": true,
     "style": "heading"
     },
     {
     "type": "Input.Text",
     "label": "First Name",
     "style": "text",
     "id": "FirstName",
     "isRequired": true,
     "errorMessage": "First Name is required"
     },
     {
     "type": "Input.Text",
     "label": "Last Name",
     "style": "text",
     "id": "LastName",
     "isRequired": true,
     "errorMessage": "Last Name is required"
     },
     {
     "type": "Input.Text",
     "label": "Email Address",
     "style": "email",
     "id": "Email",
     "isRequired": true,
     "errorMessage": "Email is required"
     },
     {
     "type": "Input.Text",
     "label": "Phone Number",
     "style": "tel",
     "id": "PhoneNumber",
     "isRequired": true,
     "errorMessage": "Phone Number is required"
     },
     {
     "type": "Input.Text",
     "label": "Your Message",
     "style": "text",
     "id": "Message",
     "isMultiline": true,
     "isRequired": true,
     "errorMessage": "Message is required",
     "placeholder": "Your message here" 
     }
     ],
     "actions": [
     {
     "type": "Action.Submit",
     "title": "Submit",
     "data": {
     "id": "1234567890"
     }
     }
     ]
    }

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 802

#2
Vish WR Profile Picture

Vish WR 331

#3
Haque Profile Picture

Haque 292

Last 30 days Overall leaderboard