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 / Agent outputting raw JSON
Copilot Studio
Suggested Answer

Agent outputting raw JSON

(1) ShareShare
ReportReport
Posted on by 4
I have a Copilot Studio agent that is getting information from Salesforce via a Power Automate API.  When it reaches the point in the topic where it presents the information to the user, it produces a card with the raw JSON returned by the  flow before showing properly formatted text.  The original version of the topic simply had a message with the variable returned from the flow as its only content, but I have also tried generating adaptive cards both in the topic and the flow as well as explicitly instructing the agent in both the main description and the description of the topic to never show JSON to the user, as well as multiple changes to the nodes in both the topic and the flow regarding formatting and displaying the information, and no matter what I have tried, I have always gotten JSON before the correct card (sometimes I get the JSON and multiple cards, but the JSON has always been present).  How can I alter my agent to properly display the information to the user?  Thank you.
Screenshot 2026-03-16 135057.png
I have the same question (0)
  • Prasad-MSFT Profile Picture
    Microsoft Employee on at
    Why Raw JSON Appears
    Direct Variable Output: If you use a message node with only the variable (e.g., {{FlowOutput}}), Copilot Studio will display the entire JSON object as a string.
    No Formatting Applied: Unless you explicitly format or parse the variable, the agent will show the raw data before any further processing.

    How to Fix It
    1. Parse and Format the Output in the Topic
    • Extract Specific Fields:
    • Instead of outputting the whole variable, reference specific fields (e.g., {{FlowOutput.fieldName}}) in your message node.
    • Build a Custom Message:
    • Compose a message using the fields you want to display, rather than the entire object.
    2. Use Adaptive Cards for Structured Display
    • Create Adaptive Card in Topic:
    • Use the adaptive card designer in Copilot Studio to build a card, and bind the relevant fields from the flow output to the card elements.
    • Avoid Outputting the Variable Directly:
    • Do not use a message node with only the variable; always use cards or formatted messages.
    3. Format Output in Power Automate
    • Return Only Needed Data:
    • In your flow, use a “Compose” action to build a simple object or string with only the fields you want, and return that to Copilot Studio.
    • Adaptive Card in Flow:
    • You can generate an adaptive card in the flow and return it, but ensure Copilot Studio is set to display the card, not the raw JSON.
    4. Remove or Reorder Nodes
    • Check Node Order:
    • Make sure there are no message nodes before the card node that output the variable.
    • Remove Unnecessary Outputs:
    • Delete any message nodes that output the variable directly.
  • Suggested answer
    Valantis Profile Picture
    2,494 on at
     

    The behavior you described matches what Microsoft documentation explains about Adaptive Cards in Copilot Studio:

    • This happening because: The Adaptive Cards are meant to be rendered through an Adaptive Card node or added to a Message node as a card, not as plain text. If your Power Automate flow returns the entire Adaptive Card JSON as a string and you bind that string to a Text message node, Copilot Studio will output the raw JSON as text because it treats it as a normal string, not as a card object

     

    • The Correct design:

      1. In your topic, use an Adaptive Card node (or add an Adaptive Card to a Message node) instead of a plain text node.
      2. If the card needs dynamic data from the flow, either:
        • Return only the data fields (event name, date, status) from the flow and bind them in the Adaptive Card node using Power Fx formulas, or
        • If you must return full card JSON, insert it into the Adaptive Card node’s JSON editor, not into a text node.
      3. Avoid mixing presentation (card JSON) with data in the same variable. Keep the flow output as structured data, not as a prebuilt card string.
     
    The issue isn’t prompt-based; it’s structural. The variable contains raw JSON, and the node type is “Text,” so the system faithfully echoes the string. Only switching to an Adaptive Card node or restructuring the flow output fixes it.
     

    Source links:

     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

     

  • Valantis Profile Picture
    2,494 on at

    Hi ,

    Just wanted to check in and see if everything is working now. If you still need any help, feel free to let me know.

    Also, if the issue is resolved, it would be great if you could mark the answer as solved so others with the same question can find it easily.

     

    Thanks and have a great day!

     

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!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 600

#2
chiaraalina Profile Picture

chiaraalina 126 Super User 2026 Season 1

#3
deepakmehta13a Profile Picture

deepakmehta13a 116

Last 30 days Overall leaderboard