Sending Data from Looker to Slack

Looker can send the results of a query or a dashboard directly to Slack as an attached file.

To do so, your Looker admin must have enabled Slack in the Actions panel of Looker. For information about enabling the Slack integration in Looker, see this README file and the Looker Actions panel documentation.

When Slack is enabled in Looker, you simply create your query or dashboard, and then schedule a data delivery or use the Send option to deliver your data to a Slack channel as an attached file.

When configuring the schedule or sending your data, in the Destination field, choose the Slack Attachment option. Looker will display delivery options that are specific to Slack:

  • In the Share In field, enter the name of the Slack channel where you want to post your data. Include the leading ‘#’ character, for example, #Sales.

  • In the Comment field, enter any text you want to include with the attachment.

  • In the Filename field, enter a file name that you want to give to the attachment file.

For Slack attachments, Looker also includes the Format, Send If, and Include Links scheduling options.

If you are scheduling a data delivery, once you have configured all of the options, click Save All, and your query or dashboard will be delivered to Slack as scheduled. Or, if you are sending your data, click Send and your data will be delivered to your Slack channel.

Is it possible to integrate slack in some form that doesn’t use “Legacy Tokens”. Seems like not a very secure way of doing it. Even Slack writes on their page “Never share legacy tokens with other applications”.
It’s a real shame that this integration was implemented this way.

1 Like

Hey Dimitri, the most recent Lookerbot instructions involve creating a Slack App which doesn’t use a legacy token. Following the updated instructions will get you a more appropriate token.

Thanks Brecht, setting up a web server for the slack bot is not exactly the same as just adding api keys to Looker :slight_smile:

Agree with Dimitri. It’d be great if there was a slack integration that doesn’t require legacy tokens and/or a slackbot that doesn’t require setting up a web server.

Also @brecht - Does the “send to slack” action integrate with the slackbot at all if you have them both setup?

Thanks for the feedback @Jane_Kelly, it’s definitely on the roadmap to improve integrations here. You’re correct that the Slack integration and the Slack lookerbot are different things, the latter being more customisable, but needs its own webserver to run it.

Update: issue was fixed with Looker 5.8.* release!

Just notified Looker support agent about the issue with Data Platform > Slack Attachment integration.

Getting errors when trying to send PNG or PDF viz to Slack: “Unknown format wysiwyg_pdf” or “Unknown format wysiwyg_png”. CSV attachments work.

Hope this will be fixed soon, as getting up and running with SlackBot app is not exactly the same in terms of complexity as Data Platform Slack integration. :slight_smile:

@brecht Am I correct in thinking that you can only send Looks via Lookerbot webhooks? And that all sends via the data action will look like they are coming from the person who generated the token?

That’s correct - if that’s not ideal, an easy solution would be to set up a dedicated user in Slack for Looker and generate the token on that user:

Has anyone figured out, how to send multi element dashboards to Slack private channels?

Data actions doesn’t allow private channels and lookerbot doesn’t allow multi element dashboards.

You can use normal API tokens to send data from looker to Slack - you need to create an Slack app, and grant it the appropriate scopes. This is what I’ve granted to my app and it works with the Slack Action integration:

channels:history
channels:read
channels:write
chat:write:bot
groups:read
incoming-webhook
files:write:user

I believe the only scopes required for the action integration are channels:read, channels:write, chat:write:bot (if using a bot token, recommended), and files:write:user, but I haven’t confirmed that as the above configuration is working for my team and I don’t want to mess with it. I will caveat that we are not able to send messages to private channels with the above config - I do not believe this is possible based on the current state of the Slack integration. Also note that this configuration is not officially supported by Looker.

Thanks @jaxon_thd! Is that something new? When I click to activate slack attachments in actions, it still tells me that it requires a legacy token:

edit: I missed you last sentence before I posted the above. Got a bit too excited :slight_smile:

One of the biggest problems that we had with legacy tokens is that we need to expose the access to all the company communication. And since you need to give channel:read permission to the App it still doesn’t eliminate the security concerns, unfortunately. I just can’t imagine any bigger security aware company using it like this. Looker, please, please fix it :frowning:

I think the key point is that the legacy tokens use the same API as the normal tokens, it is only a question of access control. The legacy tokens were granted unrestricted access to the API which is why they have been deprecated. I hope that Looker will acknowledge this soon and update their documentation accordingly.

Agree that this would be nice if the offering didn’t reply on Legacy API tokens.

Is it possible to dynamically change the comments on schedule to be the names of people in Slack based on a list of values from a column? I have a look updated hourly that shows accounts that need a look from their sales rep, but @9 we might have RepA on the results, but @10 we only have RepB, so I’d like to add their usernames to call their attention but don’t call attention from others as they don’t need to know about that specific account. Is that possible?

Hey @Camila_Fracaro, that is a great idea! This is not currently possible but would be a really cool feature to add!
The repo for these actions (including the Slack messaging) is here , could you please add an issue for this Feature Request adding the details of what your use case?
:warning: this is a public repository, so please make sure not to post any sensitive data in your comments/images on the issue.
Thanks a lot!

1 Like

Hey!

We just enabled slack from the action panel via an API Token.
While scheduling reports, under the slack attachment ‘share in’ dropdown… I have a huge list of slack handles which are NOT sorted with any logic.
Also, is it possible to make this dropdown searchable ??

Did anyone find a work around? Or is this a feature request for looker

Best,
Alen

I don’t think any of these are possible right now. But, we’re working on rebuilding our slack integration from the ground up— So these are great ideas. You should open a feature request in the proper category for each one! https://discourse.looker.com/c/feature-requests

There is risk in using the lookerbot I have raised an issue as this exposes your data to the public internet if you want to use visualizations: https://github.com/looker/lookerbot/issues/159 I have looked if this is affected the same with google or azure but I would put money on yes.

Hey Ben, I saw that you and @wilg discussed this one over on the github issue. I just want to throw in the fact that we’re working on a lot of improvements to our slack action in Q3 of this year. I don’t have any more details right now, but I wouldn’t be surprised if some kind of improvement in this area was part of that.