A lot of people use Zapier to send information over to Slack, which makes sense: It's a great way to automatically share information with the team. But that information is only going to make sense if it's formatted cleanly. Here's how to format Slack messages in Zapier.
If you'd like, watch along as we format Slack messages:
To get started you're going to need to set up the app that will kick off your automated workflow (called a Zap). In this example, I'm going to pull in posts from the Zapier blog RSS feed using RSS by Zapier, but the advice outlined here should work for any of the thousands of apps supported by Zapier.
Finish setting up this first step (called the trigger), filling in the info needed for whichever app you're using. Then use Slack for your action step.
You will be asked to sign into Slack, if you haven't already, and then you'll be asked to lay out your message.
I recommend setting up a #testing channel in Slack while you experiment with formatting, but you can do it live if you're brave. Here are the things you need to know.
Use fields to pull in information from your trigger step
Fields are what allow you to pull information from previous steps, like an RSS entry from my trigger step, into your Zap. To insert data from your RSS entry, click inside any empty field, and select the data you'd like to include from the Insert Data dropdown menu below.
A drop-down menu will appear. Click anything to add it to your Slack message.
You can insert as many items as you want, and even combine them with regular text. Like this:
Feel free to add whatever information you think will be useful in the message.
Use formatting for your post
You might notice there are no formatting tools in our editor, but that doesn't mean you can't format your message. The trick is that you have to use Slack's formatting language, which is a variation of Markdown called mrkdwn
. You can read Slack's own formatting guide for a detailed breakdown, but here's a quick list of things you can do.
Put words between underscores, e.g.;
_italic_
, for italicized text.Put words between asterisks, e.g.,
*bold*
, for bold text.Put words between tildes, e.g.,
~strike~
, for strike-through text.
Put words between grave accents for a
code block
:
Begin any line of text with a greater-than sign to make a quote block:
You can also include links. Any raw URL will be clickable, and will also unfurl with a preview after the message. If you'd prefer not to display the URL in the message you can also do that, using this formatting:
Which will look like this:
This can all sound a little abstract, so let's put some of it to work in an example. I'm going to put the words "Just published" in italics and the title of the blog post in bold text. I'm also going to add a couple of links—one as a formatted link, the other as a raw URL:
Note that I can format the information pulled in from the previous step of the Zap, just like any other text. Here's how the above formatting looks in Slack.
Tweak the formatting until it looks just right. You can send a test to Slack to make sure everything is working properly, then go back and edit things. Again, I recommend making a testing channel for this, but you do you.
Emoji
You can also include emoji in your messages. This is done using the standard Slack formatting, which puts the name of the emoji between colons. For example, the thinking face emoji is :thinking_face:
. Include that in your Zap and the thinking face emoji will show up in your Slack post. Note that this also works for custom Slack emoji.
Not sure what the emoji you want to use is called? The simplest way to find out is to open Slack, add the emoji to a message, then copy the message instead of sending it.
Paste into Zapier and you should be good to go.
Customizing your bot, and other features
Done customizing your message? You can also customize how it will look. By default it will post as a bot—you can turn off this feature to post as yourself. If you decide that you want a bot, however, you can give it a custom name and icon. You can also decide whether or not to include a link to the Zap so you or your teammates can easily edit it later.
For the icon, you can use a URL to any image, or any emoji on your Slack. In my example, I named the bot "ZapierBlogBot" and used a pencil emoji for the icon. Here's how that looks again:
There are a bunch more things you can add to your Slack message if you want.
Here's a quick breakdown:
Auto-Expand links? lets you decide whether links will be expanded or not.
Link Usernames and Channel Names? lets you decide whether @usernames and #channels appear as clickable links in Slack.
Schedule At lets you define when, exactly, the message should be sent.
File lets you upload a file to Slack and include it with the message.
Thread lets you add the message to a thread. You can choose one from the dropdown, or run a search step.
Broadcast to Channel only applies if you're posting in a thread. It allows you to also post in the channel the thread is in.
It's a lot of options, and really lets you design a message that looks and functions exactly the way you want it.
If you'd like to start automating your work with Slack and Zapier, try one of these as a starting point:
Send Slack messages whenever Google Sheets rows are updated
Related reading:
This article was originally published in December 2019 and was updated by Will Harris in March 2023 to include new screenshots and video.