Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Copilot Studio - Topic Creation & Management
Answered

How can I use the content from the "When mail get flagged" trigger as input in a topic or tool?

(0) ShareShare
ReportReport
Posted on by 4

I’m running into an issue while building an agent in Copilot Studio that uses the “When an email gets flagged” trigger. The trigger correctly retrieves the email content (subject, bodyPreview, from, etc.), and I then call a tool to generate a draft reply.

Problem 1:

When I use the tool, it generates a response, but it does not seem to use the connected knowledge sources.

Interestingly, when I test the same tool in the chat environment, it does use the knowledge correctly. It seems like the tool behaves differently when triggered by an actual event versus testing.

What I tried:

I removed the tool and instead created a topic with an intent-based trigger. Inside the topic, I use “Generative answers” blocks to generate subject/body/recipient info and then pass those to a “Draft an email” action.

Problem 2:

The generated variables appear to be empty when triggered by the agent. Even when I use {{recognizertrigger.triggeringmessage.text}}, it doesn’t seem to contain the actual email content.

So my main question is:

 

Does the “When an email gets flagged” trigger pass its output (like subject, body, from) into the topic context? And if not, how can I get that email content into my topic or into generative blocks and the draft email action?

 

Any guidance, examples, or confirmations on how to properly pass the trigger data into a topic or tool would be greatly appreciated.

Categories:
  • Verified answer
    Michael E. Gernaey Profile Picture
    44,064 Super User 2025 Season 1 on at
    How can I use the content from the "When mail get flagged" trigger as input in a topic or tool?
     
    Yes, you can access them via the Trigger, but essentially they are treated as Global so for instance in my trigger later I use {OutputVariable} to access it
    Or I specifically tell my Instruction to use the Output from my Trigger (and name it). I find this works well and sometimes better than using the variales. Weird and at this millisecond might be fixed, but i have not valiated.
     
    But I have specific triggers for when emails come in, or files are generated etc and I use the above and it works fine for me, within my Topics  and passing to tools.
     
    As a matter of fact, I either
    a) Put it in the General Instructions of the Agent
    b) put it in the specific Instructions for the Action(Tool now), it just depended on what was really expected IN the specific action(tools) "personal instructions'
     
    You may have already resolved this so apologies on the delay. If you need me to share my instructions directly or sample I can but the above is how I did it and it worked perfectly.
     

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

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

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 169 Super User 2025 Season 1

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 150

#3
sandeep_angara Profile Picture

sandeep_angara 75

Featured topics