In addition to delivering content to Looker's built-in destinations, you can deliver content to third-party services integrated with Looker via an action hub server. Looker hosts and provides a stateless server called the Looker Action Hub, which implements Looker's Action API and exposes popular actions for all Looker users.
Looker is already integrated with several services (or actions), including the Slack Attachment (API Token) action, which posts an attachment with your Looker data to a Slack channel or direct message (DM). You must generate a Slack bot user token, and a Looker admin must enable the Slack Attachment (API Token) action on the Looker Actions page, before Looker can send the results of a query or a dashboard directly to Slack as an attached file. Unlike the Slack action offered in the Looker Action Hub, the Slack Attachment (API Token) is available for customer-hosted Looker deployments.
For more information about configuring a bot user to post attachments in Slack, see this README file.
Adding the Bot User to Additional Slack Channels for Data Deliveries
When setting up the Slack Attachment (API Token) app on the Slack side, you can set up a bot user with access to all public and some specified private channels. The bot user's token will determine the channels to which Looker users will be able to send or schedule data deliveries. If you need to expand the list of available channels, you will need to invite the bot user or manually add the Looker application to the channel. Any user can invite the bot user or add the Looker app to a channel.
To invite the bot:
- In your channel details, expand the Members menu, and click Add People.
- Find the Looker bot user the same way that you find individual users, and add the bot to the channel.
To add the Looker app:
- In your channel settings, open the three-dot menu and click Add apps.
- Find and click on the Looker app.
Delivering Data to Slack
- First, Looker admins must enable the Slack Attachment (API Token) action in the list of actions on the Actions page in the Admin panel.
- Create your query or dashboard, and then schedule a data delivery or use the Send option for a one-time delivery.
- When configuring the schedule or sending your data, choose the Slack Attachment (API Token) option in the Destination field. Looker will display delivery options that are specific to Slack:
- In the Share In field, select the Slack channel where you want to post your data. This channel list is based on the bot credentials you provided when setting up the Slack Attachment (API Token) app on the Slack side, and may include public and private channels to which the bot has been invited. If you do not see a channel listed, verify that the bot has been invited to that Slack channel.
- In the Comment field, enter any text you want to include with the attachment delivery.
- In the Filename field, enter a filename for the attachment file. Include the appropriate file extensions for the delivery format.
For Slack attachments, Looker also includes formatting and other advanced scheduling options.
- If you are scheduling a data delivery, click Save All once you have configured all the options, 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 immediately to your Slack channel.