Lookerbot for Slack integrates with Looker to allow you to query all of your data directly from Slack. This enables everyone in your company to share data easily and answer data-driven questions instantly. Lookerbot can expand Looker URLs and allows you to create custom commands for running saved queries.
Find technical details for setting up Lookerbot here.
Expanding Looker URLs
If Lookerbot is added to a channel and the LOOKER_SLACKBOT_EXPAND_URLS
variable is set to true
, Lookerbot will expand share URLs and Look URLs. If the explore has an associated visualization, it will show an image of that visualization. If the explore is a table, it will show the data as text.
For example, these two URLs will expand like so:
https://learnbeta.looker.com/x/3Hq6Q2j # share URL
https://learnbeta.looker.com/looks/263 # Look URL
Custom Commands
Lookerbot also allows you to create custom commands for running saved queries. This allows you to easily run common queries and answer frequent questions!
Creating Commands
In order to create custom commands, make sure to specify a custom command space using the LOOKER_CUSTOM_COMMAND_SPACE_ID
variable during setup. Any dashboard saved in this Space will be available to use as a command.
To create a new command:
-
Create a dashboard with a single element in the Lookerbot commands space. Only dashboards with single elements can currently be used with the Lookerbot.
-
Give the dashboard a discoverable name - the name of the dashboard will be the name of the command. I recommend fewer letters and all lowercase for ease of use.
-
Add global filters to the dashboard in order to pass filter values to the command. Read about how to add filters to a dashboard in Looker here. (optional)
-
Add a description to the dashboard - this will appear next to the command when a user types
help
. (optional)
If you’d like to split commands up into logical groups, you can create subspaces within the Lookerbot command space. This will group the commands in the help list.
In order to see all the available commands, type help
to Lookerbot (see how to do this below). This will give you a list like so:
Using Commands
Use a command by typing the name of the command, followed by any filter values you want to add. Filters are optional, and the query will run without that filter if no values are specified.
For example, I can run the customer map in
command, filtered for New York like so:
There are three ways to use commands:
-
@mention Lookerbot. This can be done in any channel Lookerbot is present in.
-
Use the slash command. This can be done if the slash command has been configured during set up.
-
Direct message Lookerbot. If you send a message directly to Lookerbot, you don’t need to prepend the command with anything.
Data formats
Commands will also return data in different ways, depending on the visualization type of the underlying Look. There are three possible return formats:
-
Text: If the underlying Look is a table, the data will return as text
-
Single Value Text: If the underlying Look is a Single Value visualization, the data will return as a text value
-
Image: If the underlying Look is a chart, the data will return as a image of the visualization
Hiding commands and subspaces
If you have some commands that you don’t want to appear in the help
menu, but you still want to use with Lookerbot, you can hide either the command or the entire subspace the command is saved in. Hide a command or subspace by starting the name with [Hidden]
.
For example, this subspace and this command will not be visible in the help
menu: