Receiving notifications in Microsoft Teams

Using Triggers and PowerAutomate, you are able to receive notifications in a Teams chat or channel when an inbound social message activates a trigger - be alerted to high priority messages or influencer engagement, right in Teams!

Within Orlo, Triggers allows you to automate certain actions based on incoming social messages matching certain criteria you set (i.e. Contains a particular word, is from an author that has a profile tag). Whilst most of the actions a trigger can make are around managing the message within the Inbox, you can also receive mobile push or email notifications as well as sending a webhook outside of the Orlo platform to a 3rd-party system. (Webhooks are a way for an app to provide other apps with real-time information. A webhook delivers data to other applications as it happens, meaning you get data immediately.) Below is a step by step guide to setting up PowerAutomate to receive webhooks from Orlo and convert them to a Teams notification.

1) First, head over to the PowerAutomate web app and on the left-hand list select Create, then choose Automated Cloud Flow:

2) On the next window, enter the name for your Flow (this is for your reference, it will not have an impact/restriction on the flow setup). For the flows trigger, click Skip at the bottom.

3) Enter http into the search box and select the When an HTTP request is received option

4) You will now be asked to enter the body schema for the webhook (the data structure that will be sent to PowerAutomate from Orlo). Click Use sample payload to generate schema and paste in the below text:

{

    "type": "object",

    "properties": {

        "json": {

            "type": "object",

            "properties": {

                "type": {

                    "type": "string"

                },

                "activity_id": {

                    "type": "string"

                },

                "text": {

                    "type": "string"

                },

                "href": {

                    "type": "string"

                },

                "is_monitoring": {

                    "type": "boolean"

                },

                "account_id": {

                    "type": "integer"

                },

                "account_name": {

                    "type": "string"

                },

                "account_type_name": {

                    "type": "string"

                },

                "author_name": {

                    "type": "string"

                },

                "author_influencer_score": {},

                "text_sentiment": {

                    "type": "string"

                },

                "language": {

                    "type": "string"

                },

                "visibility": {

                    "type": "string"

                },

                "in_reply_to_outbox_author": {},

                "root_thread_id": {

                    "type": "string"

                },

                "created_at": {

                    "type": "string"

                }

            }

        },

        "env": {

            "type": "object",

            "properties": {

                "hash": {

                    "type": "string"

                },

                "hook_id": {

                    "type": "string"

                }

            }

        }

    }

}


5)
Once you've pasted in the above, click below the HTTP box to add a New Step. Search for Teams, then choose the option you would like. For the rest of this guide, we will be building a flow that sends a notification to a particular channel.

6) You will be able to select what entity Teams will display as the author for the message (for this, I've chosen Flow bot so that readers know the message has come from an automated process). Then, you can select where the Flow bot will post the message and what that message will say.

As we've provided social message data in the webhook and defined that data using the schema in Step 4, we can include information in the Teams message taken from the social media activity in Orlo, such as Author Name, Account Type Name (Twitter, Facebook, LinkedIn etc) and more:

7) Once you're happy with the flow process on PowerAutomate, click Save. This will populate the HTTP POST URL field in the first step of the flow. Copy this URL and head over to Orlo to set up the webhook for use.

8) In Orlo, go to the Settings page and click Manage Webhooks (Link to page). Click Create New in the top-right corner and fill out the information required.

The Name is for your reference, but it can be helpful to use the name of the Flow in PowerAutomate to make managing/editing the Flow later on if needed. In the URL field, enter the URL copied from the HTTP step in PowerAutomate and for the Developer Email field, enter the email address of the user who should be contacted if there are any issues with the webhook. You can leave the Secret field blank for this.

9) Now that all that is done, it's time to set up your Trigger. Head over to the Triggers page and create your Trigger (or update an existing one if it's already made). You should be able to select Send webhook message as an option in the Actions area of the Trigger process, then choose the name of the Webhook you've just set up. That's it! From this point going forward, once this Trigger is activated, it will send a webhook to PowerAutomate and via the Flow you've just created, push that into Teams as a notification message.