SLACK

The Slack extension helps connect Roam to a Slack organization! The name of the script is slack.

Installation

You could use the Copy Extension button below to individually install this extension. To install, just paste anywhere in your Roam graph and click "Yes, I Know What I'm Doing".

Manual Installation

If instead you prefer to manually install, first create a block with the text {{[[roam/js]]}} on any page in your Roam DB. Then, copy and paste this code block as a child of the block.

var existing = document.getElementById("slack");
if (!existing) {
  var extension = document.createElement("script");
  extension.src = "https://roamjs.com/slack.js";
  extension.id = "slack";
  extension.async = true;
  extension.type = "text/javascript";
  document.getElementsByTagName("head")[0].appendChild(extension);
}

Usage

Add the RoamJS app to your workspace by clicking the button below. After confirming, you will be redirected to this page where you will find your Slack workspace's token.

Add to Slack

Anytime you tag a person in a Roam block, a slack icon will render next to the tag. Clicking the icon and then clicking Send will send the contents of the block to the user matching the full name of the tag.

For example, this block:

Sent from Roam!#[[David Vargas]]

Will send the following message to David Vargas in slack:

Sent from Roam!

Configuration

The Slack extension supports the following configuration options, to be added to the roam/js/slack page:

  • Token - (Required) The token generated from the RoamJS Slack App. To be added as a child of a Token block.
  • User Format - (Optional) The format that Roam tags must be in to render the slack icon. By default, it uses @{username}.
    • Use the placeholder {username} to match a user based on their slack username. For example, @{username} matches the #[[@dvargas92495]] tag.
    • Use the placeholder {real name} to match a user based on their slack full name. For example, {real name} (Slack) matches the #[[David Vargas (Slack)]] tag.
  • Channel Format - (Optional) The format that Roam tags must be in to render the slack icon for channels. By default, it uses #{channel}.
    • Use the placeholder {channel} to match a channel based on its slack channel name. For example, #{channel} matches the #[[#general]] tag.
    • For RoamJS to be able to post in a channel, you will need to add the app to the channel:
  • Aliases - (Optional) A specific mapping of Roam tags to Slack usernames to detect for the slack icon. If this is defined, User Format will be ignored. Each alias should be its own block, with the slack username it maps to as a child of that block. For example, the following maps the #[[This is Vargas!]] tag to the dvargas92495 slack username:
    • This is Vargas!
      • dvargas92495
  • Content Format - (Optional) The format that Roam will use to send the message to Slack. By default, it uses {block}.
    • Use the placeholder {block} to replace with the actual text of the block.
    • Use the placeholder {last edited by} to replace with the username of the user who last edited the sending block. If the Roam email address is not in the slack workspace, the Roam email will be inserted instead.
    • Use the placeholder {page} to replace with the name of the page the block lives in.
    • Use the placeholder {parent} to replace with the text of the parent of the current block. If you add a colon and a tag, it will grab the first parent with the given tag. For example, {parent: [[Task]]} will be replaced with Project [[Task]] in the following example:
      • Project [[Task]]
        • Ignore this block
          • Send to #[[@dvargas92495]]
    • Use the placeholder {link} to replace with the link to the zoomed in block.

Demo

Contributors

A special thanks to those who's contributions helped make this extension possible:

Emoji Key

Other Extensions