How to send notifications to Slack using Looply

How to send notifications to Slack using Looply

Many business users work in Teams, but millions of users make use of Slack for collaboration.

Not only can Looply send process notification messages to Microsoft Teams, but it can also send messages to Slack channels too, so the great news is that you can support either or both.

 

Follow these three steps to build this powerful integration:

 

1) Create an app on Slack

First of all you need to create an app within Slack.  This is free and easy, and takes only a few minutes in https://api.slack.com/apps

See the quickstart guide: https://api.slack.com/quickstart

You need to find the OAuth Token for the your app from the ‘OAuth & Permissions’ menu.

 

2) Set up a channel in Slack or choose an existing channel, and get the Channel ID from the ‘About’ tab.

You need to identify the channel ID that you are going to send the notification to.

 

3) Set up a Workflow in Looply

Create a simple workflow in the Looply Workflow Studio:

Call this workflow either externally or from another Looply workflow, passing in parameters for the notification in Slack.

In this example, we are passing in two text fields, ‘heading’ and ‘text’, from a separate Looply workflow:

Set up a function to add text formatting:

The definition of this function can be generated using Slack’s Block Kit Builder https://app.slack.com/block-kit-builder

 

return {
  "blocks": [
    {
      "type": "rich_text",
      "elements": [
        {
          "type": "rich_text_section",
          "elements": [
            {
            "type": "text",
            "text": params.heading,
            "style": {
              "bold": true
              }
            },
            {
            "type": "text",
            "text": params.text
            }
          ]
        }
      ]
    }
  ]
}

Finally, add the http request step to send the message to Slack, using the chat.postMessage api, passing in the Token code and the Channel ID:

Using this simple generic Workflow, you can send a notification to a channel with a heading in bold, and a text beneath.