What's in this article?

Send a message to users in Slack

Post a message in a Slack channel

Format your Slack message

You can use the Slack pack to send messages directly from your Coda doc with the click of a button. This makes managing tasks and your team even easier. Before you begin, install the Slack pack to your Coda doc. Visit our Using the Slack pack article for instructions on how to install.


Getting started

Once you've authenticated with the Slack pack, you can send messages directly from inside your doc.

To do so, insert a button in the canvas or within a column (column type 'button'), and select 'Slack' > 'Post message' as the button type. Then fill out each field in the button configuration.

To point the button to a slack channel, enter # and the channel name in the field.

To point to a specific person, you can use their email address directly in the field. If you have a people column in the same table, you can point the field to "[Person].[Email]" as in the example below.

One thing to note: the Slack message will come from whichever Slack account is listed in the Account field of the button. If you're sending a message to yourself from your own Slack account, you won't receive any notification in Slack.


Send a message to users in Slack

Imagine you have a table that contains a list of tasks. In this table, you have the following columns for each task listed: Task, Owner, and Task Stage. We can achieve this with a button press using the Slack pack and formulas in Coda.

To send a Slack message to all members mentioned in the Assigned column (assuming this is a People column format), we’ll take advantage of the email addresses associated with every Coda profile to send notifications directly to each assignee's DMs.

To begin, add a new button to the table. Then, click the f button to bypass the formula builder and add your own custom formula.

If you opt to copy & paste the formula below, be sure to update inputs like the User's private Slack account authentication key and any column references that don't exactly match up.

thisRow.Owner.Email

.FormulaMap(

Slack::PostMessage(

[User's private Slack account],

Concatenate(

"Your task of, ", thisRow.Task, ", is due on ", thisRow.[Due Date], "."

),

CurrentValue

)

)

After you've typed out your formula in the formula builder, it should look something like this:

Note: Our formula above uses the Concatenate() formula, but the Format() formula and the "+" can also be used.


Post a message in a Slack channel

Let's imagine you have a table with your team's weekly meeting notes and you want to post those notes on your team's slack channel. To do this, you can do the following:

  1. Add a button column to your table. Label it whatever you like. (e.g. "Send notes")

  2. To choose the button action, go to "Packs" --> "Slack" and select "Post Message".

  3. Select the Slack account you want to send the message from.

  4. Add the content of your Slack post (in this case, "Meeting notes").

  5. Type the name of the Slack channel you want to post in (e.g. "team-channel").

  6. Feel free to give your button color and an icon! 😃

Watch this gif below to see these steps in real time.

Note: Messages sent on slack default to plain text. If you want to add formatting to your messages (e.g. bold or italics), continue reading below.


Format your Slack message

If you want to add some style to your Slack message like

  • bold

  • italics

  • tagging (e.g. @here)

  • URLs/hyperlinks

check out this helpful doc from one of our very own to learn more!


Related Articles

  1. Using the Slack pack

  2. How do I use FormulaMap()?

  3. People column format

Did this answer your question?