Posting to Teams with Power Automate (Flow): Incoming Webhook verses Teams – Post Message

The more I explore Office 365, and it’s options on integration, the more I love it. I’ve been very focused on using Flow for my integration stories, which, for the most part, works just as expected.

I came across this article which has re-introduced to me the idea of using web hooks to post to Teams. Starting Microsoft Teams conversation on items from SharePoint list. In this article, instead of using the Teams Post message action, the writer decided to use an Incoming Webhook. I instantly remembered this option was here and thought, huh, what’s the difference with what I’ve been doing?

My examples here come from my existing Flow I created earlier.

What is the Incoming Webhook?

Basically, it’s a URL provided by Teams for any service to use to post content with the goal of sharing that content in your team’s channel.

When you configure it, you get a URL which you can then post a JSON request to. (JSON is a long formatted string that helps standardize data.)

The final output, or the post in Teams, is a pretty card, similar to:

Flow pushing content to Teams via Incoming WebhookThe Flow action looks like this:

Microsoft Flow action for HTTP Post to Teams Incoming Webhook

You can enable an Incoming Webhook by going to the connectors for the channel. If you want more detail, let me know and I can write up a walk through.

What is Microsoft Teams – Post message action in Flow?

This is a specific action in Flow for writing to your team’s channel. This is a wee bit more basic and will suffice for most business users. When you use this action, all you get is a single open field, in which you can put content and HTML to make your post look a little prettier:

Flow post a message to teamsAnd it’s Flow action looks like this:

Microsoft flow post a message to teams

What I like about the Incoming Webhook

The incoming webhook might be my new favorite way to post to Teams:

  1. Standardized format, looks more “professional”, more authoritative in my feed.
  2. Formatting supports Markdown or HTML.
  3. It uses a “service account”, instead of the name of the person who created the Flow.
  4. Can have additional actions taken on the message card (another blog post coming soon).

But beware

  1. It’s more work, formatting the JSON can be tricky. But I think in the long run worth it.

What I like about Teams Post message in Flow

This still may fit in some basic flows:

  1. It’s quick and dirty, get’s the data in there

But beware

  1. Everything gets posted under your account, or the account of the person creating the Flow.

Which one should you use?

As always, it depends on your need. If you simply want to quickly post an update, use the Teams Post message action. If you want it cooler looking, functional, use the Incoming Webhook.

Resources:

Some nice resources from Microsoft and the community on understanding the incoming webhooks more!

Done!

What do you think? Which method will you try next?

15 thoughts on “Posting to Teams with Power Automate (Flow): Incoming Webhook verses Teams – Post Message

Add yours

  1. Hi David,

    Great content! I am trying to use flow to send emails when a specific message is posted from a webhook. Right now I have a condition that looks for the application ID, however I am having trouble with parsing the JSON to look for a specific text string. Any recommendations on how to trigger actions on specific messages? This webhook posts other messages to the channel so I don’t want it to trigger for every message posted.

  2. Well crap. Started going through this and then found out that the HTTP action is a “Premium” connector and not included in an E3 license?

    I have an Office Form and when someone fills it out, I want to create a post in Teams with some of the details. If can use the Post in Teams action but then all the posts have my name on them. I was hoping I could use this instead but it looks like not? Is there any other way to accomplish what I’m trying to with a regular Flow and E3 license?

    1. I think I only have an E3 as well, I’ll double check my license and the action I’m using. That’s surprising if it’s a premium action 🥺

      1. I actually found that you might not need to do the webhook thing any more. I now see an action under Teams that says it will post an adaptive card, as the flow bot, to a channel. Now I’m just trying to figure out why it doesn’t like my card code. :)

  3. Hi David,

    I am new to Flow but I really want to be able to do what you have done above. Is it possible for you to send me a screenshot to the whole Flow?

    I am a Prinicpal of a school in the UK. I have created a Flow whereby if a teacher requests an absence from work in a Microsoft Form, Flow sends it to me for an Approval, when I approve it then does a Team’s Posts a Message in a channel that we use for HR to confirm the date and time that member of staff will be absent. It would be great if I could do that in the format you have shown above?

    Also, and I imagine this is trickier. Would be possible to post the approval in a card format in the team itself? I would then click the approve button without having to approve in the Flow for Teams section.

    Thank you – love the blog by the way!
    Andrew

      1. Actually, I did try it a few months ago but it didn’t work. If I remember correctly, there was this authentication issue involving tokens so I cannot target a “When an HTTP request is received” trigger in flows from an Actionable MessageCard in Teams. I tried the same use case again just yesterday and interestingly enough, it worked. I guess they fixed it.

      2. Hi David, I’ve been having issues with getting actions to work on cards posted using incoming webhooks in a Teams channel. Do you know how I can make it work? I keep running into the error The remote endpoint returned an error (HTTP Unauthorized). Please try again later..

  4. Do you know if it’s possible to post a message after the completion of a meeting in MS Teams? I am looking for that as a trigger but haven’t found a good solution. Thanks!

Leave a Reply

Up ↑

Discover more from David Lozzi

Subscribe now to keep reading and get access to the full archive.

Continue reading