Skip to main content

Notifications

Community site session details

Community site session details

Session Id : EqKzAyaL7rcOB5ErLVrXqt
Copilot Studio - General
Answered

Can I use adaptive cards to display and select the values of variables in the question function?

Like (0) ShareShare
ReportReport
Posted on 9 May 2024 05:09:59 by 7

We created 3 variables. Afterwards, I wrote the following in the question function properties with the adaptive card.

{
  type: "AdaptiveCard",
  version: "1.5",
  body: [
    {
      type: "TextBlock",
      text: "hello!!!",
      wrap: true,
      horizontalAlignment: "Center"
    },
    {
      type: "Container",
      items: [
        {
          type: "ActionSet",
          horizontalAlignment: "Center",
          actions: [
            {
              type: "Action.Excute",
              title: Topic.testKeyword1,
              id : "test1"
            }
          ]
        },
        {
          type: "ActionSet",
          horizontalAlignment: "Center",
          actions: [
            {
              type: "Action.Excute",
              title: Topic.testKeyword2,
              id : "test2"

            }
          ]
        },
        {
          type: "ActionSet",
          horizontalAlignment: "Center",
          actions: [
            {
              type: "Action.Excute",
              title: Topic.testKeyword3,
              id : "test3"
            }
          ]
        }
      ]
    }
  ]
}

However, nothing appears on the screen and no value is entered in actionSubmitId. Is there any way to solve this?

  • Verified answer
    adilei Profile Picture
    on 10 May 2024 at 08:56:35
    Re: Can I use adaptive cards to display and select the values of variables in the question function?

    Here is a sample that works - it should get you going:

     

    kind: AdaptiveDialog
    beginDialog:
     kind: OnRecognizedIntent
     id: main
     intent:
     triggerQueries:
     - dynamic card
    
     actions:
     - kind: SetVariable
     id: setVariable_iAxgu7
     variable: Topic.testKeyword1
     value: My Title
    
     - kind: SendActivity
     id: sendActivity_xX4y2P
     activity:
     attachments:
     - kind: AdaptiveCardTemplate
     cardContent: |-
     ={
     type: "AdaptiveCard",
     '$schema': "http://adaptivecards.io/schemas/adaptive-card.json",
     version: "1.5",
     body: [
     {
     type: "ActionSet",
     actions: [
     {
     type: "Action.Submit",
     title: Topic.testKeyword1
     }
     ]
     }
     ]
     }

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Copilot Studio - General

#1
ricardodesouza Profile Picture

ricardodesouza 2

#1
L-1234567-0 Profile Picture

L-1234567-0 2

Overall leaderboard
Loading started
Loading complete