web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / How to post a message ...
Copilot Studio
Suggested Answer

How to post a message in Teams - from an autonomous flow

(1) ShareShare
ReportReport
Posted on by 10
Hi, I have an Agent with a flow should be simple:
  1. Trigger: when new email arrives
  2. Description: analyze the body of incoming emails and if the content suggests that the email is urgent then send a message in Teams
The Teams tool is defined to send to "Chat with Flow bot".
 
No matter what I do, the Agent won't format the body of the message to Teams properly.
 
It starts with this error:
Error Message: Evaluating PowerFx expression resulted in error while invoking the connector : Expected to get object for property body but got StringValue Error Code: ConnectorPowerFxError
 
So I tell the Agent to send the body as a JSON object, and I'm getting another error:
Error Message: The connector 'Microsoft Teams' returned an HTTP error with code 400. Inner Error: Message body is missing. Error Code: ConnectorRequestFailure
 
This was the message I saw in the Teams activity:
{
  "message": "The user has expressed frustration or anger with the statement: 'I'm fed up! Get back to me at once!!!' This may indicate a serious issue that needs immediate attention."
}
 
 
So the question is:
What is the correct way to tell Copilot Agent to send a message using Teams?
 
On a personal note: I'm very disappointed that something that should be so obvious and straightforward doesn't "just work".
 
Thank you!
I have the same question (1)
  • Michael E. Gernaey Profile Picture
    53,479 Super User 2025 Season 2 on at
     
    So without seeing the actual Flow its extremely difficult to help.
     
    The error itself makes sense, in the sense that its clear the issue.
     
    What is not clear is what action is causing that, what values were provided etc.
     
    If you can share the flow itself it will be easy to resolve, but what is being provided to the Flow (forget agent) is not valid so its not working. Share that and we can definitely help you :-)
  • DM-14071605-0 Profile Picture
    10 on at
    Responding to @Michael E. Gernaey 's request to get my flow, as to understand what can be the cause.
     
    I don't have that flow anymore, and the text therein. I gave up on Copilot Studio to be able to do this simple task of sending a message to Teams, and I solved it in a different way, still with Copilot Studio:
    • In the Copilot Studio flow, when an incoming email is flagged, send an email message with a specific subject. If it's not flagged, send an email with a different subject.
    • Create a rule in Outlook, to move messages with these subjects to a specific folder.
    • Create a Power Automate flow to monitor the specific folder, and send a message to Teams when the relevant subject arrives. This Power Automate flow is also good for additional automations in which I want to get a message in Teams.
    Question: why did I need to send emails even when the message wasn't flagged?
    Answer: I couldn't get Copilot Studio to NOT send an email when a message wasn't flagged, so I told it to send a message with a subject I simply ignore.
     
    It seems that Copilot Studio as still some way to go. There's a lot you can do with it, but when it comes to simple benign actions and their conditions, it fails miserably.
     
    Thank you for taking the time to reply, @Michael E. Gernaey. If you're really interested in seeing the marvel of Copilot Studio failing to send a message to Teams, just create a flow that tries to do it.
     
    All the best!
  • Michael E. Gernaey Profile Picture
    53,479 Super User 2025 Season 2 on at
     
    As I have many flows that send to teams, I have to call this user error. You posted just to complain and shared nothing useful.
     
    Many of us have working flows that send to teams, the fact yours didnt work doesn't prove its Teams since your error states clearly you are passing in a NULL value, which is a problem with the flow, of course it will not work.
     
    In the future if you want help please post the actual flows so we can help, as its a waste of everyones times an energy to try to help just to be told you won't and cannot share.
     
    I will be deleting this post as it serves no purpose.
  • DM-14071605-0 Profile Picture
    10 on at
    Hi @Michael E. Gernaey, before you delete this post, do you have any reference, anywhere at all, as to how to make this kind of a process to work?
     
    I had to do my best using Copilot, and couldn't find a single resource.
     
    And I did wait for a few days for an answer before going ahead and fixing my flow to something that actually worked. I'm not here to waste anyone's time.
  • DM-14071605-0 Profile Picture
    10 on at
    @Michael E. Gernaey, I attached a very simple flow that works on incoming emails with the subject "send to teams", and tries to send a message to Teams.
     
    It fails immediately on the format of the message, before even trying to send it.
     
    I believe you when you say that everyone does it all the time without issues, but as you can see I get stuck at stage one. Even when I pass it, I get another error, and then another. It never gets to a point in which it just works.
     
    If I can get this simple flow to work, that would be a huge leap forward.
     
    Thank you!
  • Michael E. Gernaey Profile Picture
    53,479 Super User 2025 Season 2 on at
     
    I will write you one and look at yours. Sorry i was still asleep surgery and kidney stones kicking my b.... lol
     
    give me an hour tops and you will have one i gotta eat real fast and get pain meds in me or pass out ugg hehe
     
    brb promise
  • Michael E. Gernaey Profile Picture
    53,479 Super User 2025 Season 2 on at
     
    I just downloaded your example and am taking a look at it with mine as well.
  • Michael E. Gernaey Profile Picture
    53,479 Super User 2025 Season 2 on at
    ok working it right now so sorry, scheduling procedures etc. give me a moment
     
    Ahh you didnt put in the connection references etc so i will just have to make my own based on what you are doing.
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,479 Super User 2025 Season 2 on at
     
    So I wrote a simple test and it works fine.
     
    I receive the email, convert the body, validate if its urgent. This works as a trigger to my Agent.
    in teams I receive my message. I am sending the entire Body to Teams, and so stuff is missing because the links wont work on purpose.
    But otherwise it works just fine.
     
    So I would need to see your Flow Run, the one that fails, to tell you whats wrong with yours.
     
     
     


    If these suggestions help resolve your issue, Please consider Marking the answer as such and also maybe a like.

    Thank you!
    Sincerely, Michael Gernaey
  • Michael E. Gernaey Profile Picture
    53,479 Super User 2025 Season 2 on at
    if you want me to leverage your test project, you have to go into the solution and add missing dependencies and then share it again. 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 270 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 181 Super User 2025 Season 2

#3
S-Venkadesh Profile Picture

S-Venkadesh 93 Moderator

Last 30 days Overall leaderboard