Search documentation...

K
ChangelogBook a demoSign up

Slack

Sync your warehouse with Slack and push business metrics and user activity data to Slack in real-time

Overview

With the Slack destination, Hightouch can serve as a notifier for various data-related events or changes. This is a very flexible integration, but here are a few example use cases:

  1. Notify your customer success teams when product usage for a key account suddenly drops
  2. Notify an account executive when product usage surpasses a certain threshold
  3. Send a daily summary of the number of sign ups compared to the same day last month
  4. Send a daily summary on the adoption of a core feature

Supported syncing

ModeDescription
MessageSends individual messages for each record that was added or removed since the last sync. There will be no messages for the initial run.
Batch MessageSends a formatted message or multiple messages with plaintext or Slack block kit of all the records in the query results.
TableSends a formatted table of all records in the query results for the each sync as a single message.
CSVSends a CSV file of all records in the query results for the each sync attached to a single message.

Slack error alerting

To set up Slack as your error alerting tool, see the Slack section of Error Alerting

Getting started

Authenticating with OAuth

Use OAuth to connect Slack by navigating to Destinations > Create New > Slack. Click "Connect" and log in with your desired Slack account. Once you have selected your desired workspace, click "Allow" and it will bring you back to Hightouch with an "Authorization successful" screen. Finish your setup of this destination by clicking the continue button and naming your Destination.

If you run into any issues on this step, you can also add the Hightouch Slack App to your Slack Workspace by visiting the app page and selecting Add to Slack. Once you follow this approval flow, retry the previous steps to create a Slack destination on the Hightouch App.

Adding the Hightouch bot to channels

In order for Hightouch to message your channel, you need to ensure the bot is invited to the channels. Follow the steps below to add the bot to your channel.

  1. Go to the channel and next to the name, select the drop-down button

  2. Select Integrations

  3. Select Add Apps

  4. Search or look for Hightouch

  5. Select Add next to the Hightouch app name

Sending Slack Messages for added and removed rows

Hightouch supports sending messages based on rows that have been added or removed since the last sync run. Each row is sent as an individual message and can be sent to different channels and templated with Liquid.

Message formatting is best when the following conditions are met:

  1. You want to write a query and have Hightouch detect the added and removed rows
  2. You want a custom message sent per each added and/or removed row

Hightouch doesn't send any messages on the initial sync run to prevent a flood of messages to your channel. Messages start appearing after the initial sync run.


If you want avoid this behavior, modify your model query to return only one "test" row. Hightouch processes this row during the first sync run and doesn't send it as a message to Slack. Afterward, update your model query to include all rows from your source. Hightouch syncs all subsequent rows to Slack during the second sync run.

Channel selection

Hightouch supports both sending messages to a specific channel that the Hightouch bot is part of, or by pulling the channel ID each row. Enable the "Use column" toggle to dynamically set the target channel.

Added and removed messages

Hightouch allows you to template the content you would like to send in your message.

  • When a row is added in your query results, Hightouch will send the row added content.
  • When a row is deleted in your query results, Hightouch will send the row deleted content.

This content can be templated and also supports Slack block kit.

Sending Slack messages (all results)

The batch message mode is similar to the normal message mode, except it sends all rows in the query results rather than only added / removed rows since the last sync.

This mode also allows you to specify how many rows are sent per message, which can range from 1 to 20. With 1 row per message, it would be similar to the message mode, whereas 20 rows per message would be similar to a tabular representation.

This format is good for the following scenarios.

  1. You want to write a query, and have Hightouch push a message containing all rows, formatted as a message, to Slack
  2. You don't want Hightouch to detect added and removed rows, but instead want to send all rows on each query run

Channel selection

The batch message only supports sending your messages to a single channel.

For each message, Hightouch allows setting the header, footer, and row content. Only the row content is required. The row content is repeated per row in the message and has access to the row values via templating.

This content can be templated and also supports Slack block kit.

Templating messages

Liquid templating

For both the message and batch message modes, Liquid templating is supported. The most important implication of this is that columns from the added or removed row can be accessed as part of the message body. Here is an example message making use of Liquid to insert a column into the message.

User with name {{ name }} and email {{ email }} has signed up

Tagging Slack users (@...)

Hightouch supports tagging users by either their Slack user ID (if you have it in your warehouse) or by email.

  • Tagging by User ID: tag by user ID by writing <@{{ userId }}> where userId is the column that contains the user's Slack ID, just as using Liquid templating. If the userId is a static value, you can write something like <@UL53466SY>.
  • Tagging by Email: tag by email by writing <@{{ email | slack_user_lookup }}> where email is the column that contains the user's email used in Slack. If the email is a static value, you can write something like <@{{ "example@gmail.com" | slack_user_lookup }}>.

By default, Slack automatically unfurls (displays a preview) URL links in your messages. To prevent automatic unfurling, surround the URL with backticks, for example:

https://www.hightouch.com/

(Note: The backtick is usually located above the tab key on the left-hand side of the keyboard).

Formatting text for Slack app surfaces

Slack provides an extensive guide to formatting surfaces in Slack apps. Please see the guide for instructions on how to:

  • Format text
  • Insert emojis
  • Mention users, groups, and channels
  • Format dates, quotes, and lists

Slack Block Kit

To enable Slack block kit, select "Slack Block Kit" for the content type. Make sure to use Slack's Block Kit Builder to draft your message content.

Each message content must be an array of Slack blocks, here is an example of a valid configuration.

The "Preview Block Kit" button next to your message content allows you to view your content as a Slack message. (View an example).

Table

Table formatting sends all of your query results formatted as a text table as messages to Slack. This mode is recommended only for small sets of data.

This format is good for the following scenarios.

  1. You want to write a query, and have Hightouch push a message containing all rows, formatted as a table, to Slack
  2. You don't want Hightouch to detect added and removed rows, but instead want to send all rows on each query run

Channel selection

The batch message only supports sending your messages to a single channel.

Customizing bot appearance

Hightouch also allows you to set how the bot is displayed when sending the update. This can be configured with the following fields

NameDescription
Icon Image URLURL of 48x48 image of the icon that you wish to use
Icon EmojiSlack emoji (for example, :sweat_smile:), this will overwrite icon image URL
Bot NameDisplay name of bot

Keep in mind that users in the channel will still be able to see that the bot is Hightouch by clicking on it.

Tips and troubleshooting

Common errors

If you encounter an error or question not listed below and need assistance, don't hesitate to . We're here to help.

Invalid_blocks

Using "plain_text" instead of "mrkdwn" in your Slack Block Kit syntax is the most common cause of this error. You can find examples of the correct syntax to use in the Slack Block Kit section of this page.

Live debugger

Hightouch provides complete visibility into the API calls made during each of your sync runs. We recommend reading our article on debugging tips and tricks to learn more.

Sync alerts

Hightouch can alert you of sync issues via Slack, PagerDuty, SMS, or email. For details, please visit our article on alerting.

Ready to get started?

Jump right in or a book a demo. Your first destination is always free.

Book a demoSign upBook a demo

Need help?

Our team is relentlessly focused on your success. Don't hesitate to reach out!

Feature requests?

We'd love to hear your suggestions for integrations and other features.

Last updated: Mar 9, 2023

On this page

OverviewSupported syncingSlack error alertingGetting startedAuthenticating with OAuthAdding the Hightouch bot to channelsSending Slack Messages for added and removed rowsChannel selectionAdded and removed messagesSending Slack messages (all results)Channel selectionHeader, body, and footer contentTemplating messagesLiquid templatingTagging Slack users (@...)Unfurling links and blocking unfurlFormatting text for Slack app surfacesSlack Block KitTableChannel selectionCustomizing bot appearanceTips and troubleshootingCommon errorsLive debuggerSync alerts

Was this page helpful?