# Post the report to Slack | DRE

> The workbook lands in a Slack channel, or one person’s DM, with your message and a preview.

[← All use cases](https://getdre.com/#use-cases)

# Post the report to Slack

Some people live in Slack, not email. A Slack destination uploads the file to a channel as one post, with a message you template, and Slack previews the workbook in the thread. A channel is given by name or ID; a person by user ID, for a DM.

Recorded from a real run: the command, then the post in Slack.

Recorded from a real run: the command, then the post in Slack.

![A Slack channel with a post from the DRE bot: a message and the attached Excel workbook, previewed](https://getdre.com/media/slack_post/slack.webp)

The post in Slack (a real screenshot of a test workspace, cropped to the message).

reports/slack\_post/slack\_post.yml

```yaml
queries:
  - {query: finance_regions, tab_name: By region}
output:
  format: xlsx
  columns:
    net: {format: "#,##0.00"}
  destination:
    profile: slack
    channel: "#test-reports"
    message: ":bar_chart: Sales {{ period(var('period')).start.date }} to {{ period(var('period')).end.date }}"
```

profiles.yml

```yaml
destinations:
  slack:
    target: dev
    targets:
      dev: {type: slack, token: "{{ env_var('DRE_SECRET_SLACK_BOT_TOKEN') }}"}
```

terminal

```bash
dre run slack_post
```

### What to notice

-   The bot token stays in an environment variable and is never logged.
-   Scopes the Slack app needs: files:write always, plus channels:read and groups:read to post to a #name (or give the channel ID instead). A DM also needs im:write and chat:write.
-   The bot has to be in the channel: /invite it first. A private channel needs the invite too.
-   A missing scope or channel is reported with what to fix, and the output stays in target/.

### In the docs

-   [The slack destination →](https://getdre.com/docs/plugins/#slack)
