Skip to main content

Notifications

Copilot Studio - General
Answered

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

Posted on 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
    adilei on at
    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
     }
     ]
     }
     ]
     }

Helpful resources

Quick Links

Exciting News for Copilot Studio Communi…

Get ready to experience a whole new level of engagement with the Copilot Studio…

Celebrating the May Super User of the…

LaurensM is an exceptional contributor to the Power Platform Community…

Check out the Copilot Studio Cookbook…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
renatoromao Profile Picture

renatoromao 6,459

#2
Pstork1 Profile Picture

Pstork1 1,995

#3
Expiscornovus Profile Picture

Expiscornovus 1,708

Leaderboard