Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Copilot Studio - General
Answered

How-To access topic variables from within an adapative card in a message node

(1) ShareShare
ReportReport
Posted on by 7

I have a topic with variables that I want to display inside an adaptive card within a message node.  The adaptive card does not process the ${var1} reference in the textblock element.  Is this even possible?

Categories:
  • MurtuzaD Profile Picture
    24 on at
    Re: How-To access topic variables from within an adapative card in a message node

    Hello @MattJimison,
    This was very helpful. But when I switch to Formula mode from JSON, there are no outputs from the adaptive cards. How to get outputs in Formula mode as well?

  • aparnaa Profile Picture
    95 on at
    Re: How-To access topic variables from within an adapative card in a message node

    i was trying to see how to send the tkt ID back to the user using adaptive card. This video helped me 

     

  • cloudatica Profile Picture
    42 on at
    Re: How-To access topic variables from within an adapative card in a message node

    Here is a video explaining this in detail: https://www.youtube.com/watch?v=5qWIIyyMmxo 

  • Verified answer
    MattJimison Profile Picture
    577 Most Valuable Professional on at
    Re: How-To access topic variables from within an adapative card in a message node

    @Brian-65 I'd recommend checking out:
    https://learn.microsoft.com/en-us/power-virtual-agents/unified-authoring-conversion#upgrading-to-power-virtual-agents-unified-authoring

     

    Yes - you can use the Adaptive Card Designer (https://adaptivecards.io/designer/) to build your card, then copy/paste it into the adaptive card in PVA. Once you switch from JSON to Formula, you'll then be able to inject your own data. I recommend creating a copy of the JSON prior to switching to the Formula, though, because if you try and switch from Formula back to JSON, the entire card will get reset. This will allow you to more easily recover your card should you get into a situation where your Formula is erroring out and you want to start over again.

     


    Find this post helpful? Please mark it as the solution and/or provide kudos so that it will help others in the future.

    Cheers,
    Matt

  • Brian-65 Profile Picture
    7 on at
    Re: How-To access topic variables from within an adapative card in a message node

    Hi @MattJimison.  Thanks for the information.  Is this documented anywhere?  Also, is it possible to use the adaptive card editor to export the JSON is this format?  I have a very large adaptive card.

  • MattJimison Profile Picture
    577 Most Valuable Professional on at
    Re: How-To access topic variables from within an adapative card in a message node

    Hi, @Brian-65.

     

    When you create your adaptive card, you'll want to switch from JSON to Formula in the adaptive card properties, and once you've done that, you can reference topic variables via Topic.VariableName.

     

    MattJimison_0-1686941640425.png

     

     

     

    Below is a simple example where I'm referencing a UserName variable within the adaptive card:

     

    {
     type: "AdaptiveCard",
     '$schema': "http://adaptivecards.io/schemas/adaptive-card.json",
     version: "1.5",
     body: [
     {
     type: "TextBlock",
     text: Topic.UserName,
     wrap: true
     }
     ]
    }

     


    Find this post helpful? Please mark it as the solution and/or provide kudos so that it will help others in the future.

    Cheers,
    Matt

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

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

Leaderboard > Copilot Studio - General

#1
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 76

#2
Pablo Roldan Profile Picture

Pablo Roldan 61

#3
stampcoin Profile Picture

stampcoin 10

Overall leaderboard