Howtos Tips

The New World of Teams Webhooks

As you may have heard, Microsoft in their infinite wisdom has decided to retire “Office 365 Connectors” for Teams. At first this sounds innocuous until you realize this also includes the incoming webhook connector which allows webhooks to trigger Teams messages. Thats a very handy feature in the world of automation.

The replacement solution is to use “Workflows” which is really just a fancy name for PowerAutomate also/previously/better known as Flow. There are a variety of reasons why this is less than ideal but it is what it is. Unfortunately, the template that Microsoft supplies is not a drop in replacement. Specifically, the template assumes that you will be sending multiple JSON attachments (not in the body) that are each in the “Adaptive Card” format. Unlikely for any existing apps.

What we want to do is grab the values from JSON supplied in the webhook and post with those variables into a chat or channel. You can do that by starting with a blank Flow and using the “When a Teams webhook request is received” trigger.

Then use a Parse JSON action and supply the schema of the JSON message you will be sending. Use the “sample payload” link to generate the schema for you. This example has a JSON message with two values: name and age

Once you’ve done this you can add a “Post a message” action and access the variables from within the JSON

Leave a Reply

Your email address will not be published. Required fields are marked *