Send an alert to Microsoft Teams channel

Published August 26, 2022
Modules
Difficulty
Selected Clients
ccc logo

You can integrate Synerise with Microsoft Teams using a dedicated node to build a variety of business scenarios. One of them is building a workflow that sends messages to a Microsoft Teams channel based on metrics, expressions, reports or any other analyses created in Synerise. Sending alerts can be additionally dependent on the value of these analyses and you can send messages if the value of the analyses is greater or lower than a specific number.

This particular use case uses a metric which analyzes percentage decline of transactions every day. If the number of transactions decreased the day before by 50% compared to the average for the last 30 days, the message with alert is sent to a specific channel on Microsoft Teams. The message to the channel contains information with the value of the metric.

Prerequisites


Process


In this use case, you will go through the following steps:

  1. Create a metric which counts the change in transactions. It calculates percentage change in transactions the day before compared to the daily average for the last 30 days.
  2. Create a workflow which sends the message to the Microsoft Teams channel.

Create a metric which counts the change in transactions


In this step, we will create the metric, whose result will be later sent in the Microsoft Teams message. This specific metric will count the change in the amount transaction.charge events in comparison to the average from previous 30 days. The result of the metric will be expressed as a percentage. The message to the channel will contain information with the value of the metric.

  1. In Synerise, go to Analytics icon Analytics > Metrics > New metric.

  2. Enter the name of the metric.

  3. Choose the Formula metric.

  4. Build the formula of the metric as shown in the screen below:

    Configuration of the metric which counts the change in transactions
    Configuration of the metric which counts the change in transactions

    Where:

    • The time range for the first transaction.charge event (on the left side) is set to Last 1 day before 1 day.
    • The time range of the second transaction.charge event (in the middle) is set to Last 30 days before 2 days.
    • The time range of the third transaction.charge event (on the right side) is set to Last 30 days before 2 days.
  5. Confirm by clicking Apply.

Results: The results will show by how many percent transaction events increased or decreased in comparison to the average from previous 30 days.

Create a workflow


In this part of the process, you will create a workflow that sends a message to the Microsoft Teams channel if the number of transaction events decreased more than 50% comparing to the average in previous 30 days.

  1. In Synerise, go to Automation > Workflows > New workflow.
  2. Enter the name of the workflow.

Configure the trigger


As the first node, select the Scheduled Run node in which you will define the frequency of triggering this workflow and schedule the start of the workflow.

  1. Start with the Scheduled Run node. In the configuration of the node:
    1. Set the Run trigger option to all time.
    2. Select the Everyday tab.
    3. Select the time zone.
      Important: Select the time zone consistent with the time zone selected for your workspace.
    4. Select the time when the workflow will be launched.
    5. Confirm by clicking Apply.
The configuration of the Scheduled Run node
The configuration of the Scheduled Run node

Configure the Metric Filter


In the Metric Filter node, you will select the metric prepared in the previous part of the process. The continuation of the workflow will depend on the result of the metric. If the metric result is lower than 50, the alert about significant transaction events decrease will be sent to a Microsoft Teams channel.

  1. On the Scheduled run node, click THEN.
  2. Choose the metric created in the previous step.
  3. As the condition, by using the mathematical operators, set the metric result to be less or equal -50.
  4. Apply changes.

Configure Microsoft Teams Integration node


In this step, you will configure the settings of the outgoing integration that sends the message to the Microsoft Teams channel.

Create a connection

  1. On the Metric Filter node, click THEN.
  2. From the dropdown list, select Microsoft Teams > Send channel message.
  3. In the configuration of the node:
    • If you already create a connection, select the connection from the list.
    • If you haven’t created any connection yet:
    1. At the bottom of the dropdown list, click Add connection.
    2. In the Incoming Webhook URL field, enter the incoming webhook URL you created as a part of prerequisites.
    3. Click Next.
    4. In the Connection name field, enter the name for the connection you created.
    5. Click Apply.
      Result: A connection is created and selected.

Define the integration parameters

  1. In the Type of message dropdown list, select the Simple message.
  2. In the Text of message field, enter the text of message that will be sent to Microsoft Teams channel. In the message, you can insert the result of metric created in the previous step. This way the result of the metric will be sent to the Microsoft Teams.

See the example message with metric insert:

Check the transaction level! It decreased for more thank 50% comparing to the average from last 30 days. The metric result is: {% metricsvar metric_id:78d31e68-d886-4fcb-9ca3-b2136e74be01 %}{{ metric_result }}{% endmetricsvar %}%.
Important: Check the instruction of usage inserts with metrics. It might be helpful in creating your own message.

Add final setting to your workflow


  1. Add the End node.
  2. Launch the workflow by clicking Save&Run.
Configuration of the workflow that sends alert messages based on the metric results to the Microsoft Teams channel
Configuration of the workflow that sends alert messages based on the metric results to the Microsoft Teams channel

Result: The message is sent to the Microsoft Teams channel.

Check the use case set up on the Synerise Demo workspace


Directly in our Synerise Demo workspace, you can check the configuration of the metric which counts the percentage change in transaction events and the workflow configuration.

If you don’t have access to the Synerise Demo workspace, please leave your contact details in this form, and our representative will contact you shortly.

Read more


😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker