Building and customizing solutions using Microsoft 365 Copilot APIs and tools
Correctly fill 'To' and 'CC' in Copilot agent auto drafting email replies
I'm trying to build a Copilot agent that automatically takes in incoming emails, and drafts a reply in-thread in my tone of voice.
It uses the Trigger 'When a new email arrives V3', and Tool 'Reply to email V3'.
When testing, Copilot does generate a concept in my tone of voice, as a reply in-thread to the incoming email. However, it doesn't fill in the 'To' and 'CC' fields and gives the 'Inner Error: A message needs to have at least one recipient'.
Under the 'Reply to email (V3)' I can fill in the 'To' and 'CC' fields with 'Dynamically using AI' but then I get the question from the AI: 'To whom would you like to send the reply email?'. But of course I want it to use the 'To' and 'CC' from the incoming email automatically.
I can set both to a Custom Value, but can't find the To and CC from the incoming email variables in the variable list (not under System or Environment). I've tried initializing a variable in the Power Automate flow, but that also led to more errors.
How do I go about this?