Data Driven Slack Messaging with Alteryx

Posted by Kevin Anderson on September 8, 2016

If you keep up with the Arkatechture blog you may have read how our software engineers are using Raspberry PI’s to post messages to our slack channels when a fresh pot of coffee or popcorn is ready for consumption. This got me thinking- wouldn’t it be great if we could post messages with more data driven content? Wouldn’t it be even better if I could add this feature to the Alteryx workflows that keep our internal database up to date?

data_driven_slack_with_alteryx.png


Well, Alteryx doesn’t just let you pull data off an API, it also lets you post data as well! Read on to find out how to use Alteryx to post real time, data driven messages to your own Slack channel.

Ready To Try Alteryx?  Click Here to Download a Free Trial!

For the purposes of this writing I am going to assume you have a Slack account. If not, you can sign up for a free account at www.slack.com. Once you have an account you will need to set up a custom integration in your Slack settings. Fear not, this is not as complex as it sounds. From your slack channel append your website URL with the following: /apps/build/custom-integration. (example - https://yourslackinstancename.slack.com/apps/build/custom-integration.)

You are now ready to set up a custom integration!

From this page do the following:

 

1.Select Incoming Webhooks

image2016-8-28_17_34_38.png

 

2. Select a Default Slack Channel for this Integration.

You can always change this later. Go ahead and select the #general channel, or whichever channel you like best.

image2016-8-28_17_35_41.png

 

3.You Are Done!

On the final screen grab your webhook URL for use in Alteryx

image2016-8-28_17_36_26.png

 

 

We can now use the Alteryx download tool to post information to this URL.

The basic workflow is as follows:

 

image2016-8-28_17_38_10.png

 

The first text input tool stores the parameters for the basic parts of a Slack message, this data is then appended to the URL we created above then parsed to JSON. Finally, the JSON is posted to the Slack URL using the Alteryx download tool.

The results display as follows:

 

image2016-8-28_17_42_46.png

 

Any data Alteryx has access to can be used to create your message strings!  

Over on the Alteryx Portland, ME User Group forum is a sample workflow that does some simple data transformation on my personal Fitbit data and posts the results to Slack. This is a silly example, but can be easily adapted to more helpful use cases that involve job status/event notifications.

Read More About: Data Science

Like what you read? Subscribe to our blog!