PushMetrics comes with a integration for Slack that makes it easy to send files and messages to any public or private Slack channel, as well as to individual users.

Prerequisites: The PushMetrics Slack App needs to be installed to your Slack workspace in order to use this task.
Learn more

Creating Slack Messages

The Slack task has the following inputs:

  • Connection: If you have multiple integrations for Slack configured, you can choose which one to use here.
  • Channels: Select one or more channels or users to send the message to using the channel picker dropdown.
  • Attachments: Attachments generated by other tasks that will be uploaded to the Slack channel as files
  • Text Editor or JSON: You can design your message using a simple WYSIWYG editor or, for more advanced styling use a JSON with Slack Block Kit elements.

Selecting Channels to send to

Use the Channels dropdown to select one or more destinations. The picker automatically lists all available channels and users from your connected Slack workspace.

You can send to:

Public Channels

  • All public channels in your workspace are listed in the picker.
  • The PushMetrics bot will automatically join a public channel when sending the first message.

Individual Users

  • Users from your Slack workspace are available in the picker for direct message delivery.

Private Channels

  • Private channels where the PushMetrics bot has been invited will appear in the picker.
  • To add the bot to a private channel, go to the channel in Slack, type /invite and select "Add apps to this channel". Then, select the PushMetrics app from the list.
  • This will not allow the PushMetrics bot to read any of the messages in the channel.

Multi-person DMs (MPDMs)

  • Group DM conversations are also available in the picker if the PushMetrics bot is a participant.

Attachments

You can attach files generated by other tasks (e.g. SQL queries or charts) and upload them to Slack using the .export() function.

Once you send the attachment, your designated channel will receive a message containing the attachment.


Text Editor

The Text Editor allows you to create simple, formatted text messages.

It supports Jinja, allowing dynamic content with data from upstream tasks. You can incorporate variables and results from SQL queries to create personalized and data-driven messages.


JSON - Slack Block Kit

The JSON editor allows you to create more advanced Slack messages using Slack Block Kit UI elements.
It also supports adding Jinja for dynamic messages.

Slack Block Kit is a UI framework for designing and building rich, interactive messages in Slack. The Block Kit consists of "blocks", which are essentially building blocks you can stack vertically to create complex layouts. These blocks can be used to present information, capture user input, and more.

There are several types of blocks available, such as

  • Section Blocks: Display text alongside things like images.
  • Divider Blocks: Create visual breaks between different blocks.
  • Image Blocks: Display an image.
  • Actions Blocks: Add interactive elements like buttons or select menus.

Slack provides an online tool called the Block Kit Builder. This tool allows you to design, preview, and prototype your Block Kit layouts. It's especially helpful for visualizing how your blocks will look and behave in Slack.

PushMetrics provides a link below the JSON input that opens your current message in the Block Kit Builder:

Click here for an example.