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 capture the dir...
Copilot Studio
Unanswered

How to capture the direct agent response into a variable in Copilot Studio?

(0) ShareShare
ReportReport
Posted on by
 
Hello Copilot Studio Community,
 
I'm building an agent in Microsoft Copilot Studio and need guidance on capturing the agent's direct response into a variable.

What I'm trying to do:
 
  • I have configured my agent with instructions in Copilot Studio (using the Agent instructions section, not a Prompt node or Generative Answers node).
  • When the agent responds to a user query based on these instructions, I want to store that exact response text into a variable.
  • I then plan to use this variable downstream - for example, passing it to a Power Automate flow, logging it, or using it in conditional logic
 
My questions:
 
  1. Is there a built-in way to capture the agent's direct conversational response (the one generated from agent instructions) into a custom variable?
  2. If not, are there any workarounds ?
  3. If this capability doesn't exist today, is it on the Copilot Studio roadmap?
 

What I've already checked:

 
  • I know that responses from Prompt nodes or Generative Answers nodes can be captured using completion mapping or output variables.
  • I've reviewed the variables documentation, but I don't see a system variable that exposes the final agent response when using instruction-based responses.
 
Any guidance, screenshots, or links to relevant documentation would be greatly appreciated! 
 
Environment: Copilot Studio (web app), Power Platform environment
I have the same question (0)
  • Nivedipa-MSFT Profile Picture
    Microsoft Employee on at
    Hello ,

    Not directly — the output from the Agent instructions field can’t be stored in a variable. Because it’s generated by the autonomous orchestration layer, it isn’t exposed as a system or output variable. There’s no public roadmap commitment to change that.

    A practical workaround

    Instead, move the logic out of Agent instructions and into a Prompt action (or Generative Answers node) inside a topic, then map the result to a variable:

    Topic: HandleUserQuery
    ├─ Trigger: On Unknown Intent (or specific phrases)
    ├─ Prompt action  → input: Activity.Text
    │                   system prompt: <your former agent instructions>
    │                   output: Topic.AgentResponse
    ├─ Message node   → "{Topic.AgentResponse}"
    └─ Power Automate → pass Topic.AgentResponse

    With that in place, Topic.AgentResponse can be used for Power Automate, logging, and conditional logic.

    Other options, though less ideal

    • Dataverse Conversation Transcripts — use Power Automate to read the last bot message after the fact, not in real time.
    • Custom channel (Direct Line / bot relay) — intercept outbound activities; heavy lift.

    The Agent instructions field is intentionally opaque to topic flow — anything you need to capture has to live inside a topic node.


    If you found the information above helpful, I would appreciate it if you could share your feedback.
    Your feedback is important to us. Please rate us:

    🤩 Excellent 🙂 Good 😐 Average 🙁 Needs Improvement 😠 Poor

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
Vish WR Profile Picture

Vish WR 238

#1
Valantis Profile Picture

Valantis 238

#3
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 212 Super User 2026 Season 1

Last 30 days Overall leaderboard