How to integrate Strava into Slack

If like me you use Strava and want to brag about your latest PR with your coworkers here's the best way I found to automatically post my results in Slack. Thanks Zapier!

4 min read

February 4, 2021

Morning jog

But why?

I could answer with Why not? but there are valid reasons do to so!

  1. Why not automate mundane tasks?
  2. I love to share my physical activity. I've found out it helps everyone to stay motivated.
  3. When you're working remotely any chance you get to bond with your team should be taken!

So let's get started.

Zapier

I'm not going to explain what's Zapier, they do it well enough by themselves. If you're not familiar with them go check it out, it's pretty useful to automate mundane tasks.

If you're too lazy to read this post and only want the Zap, I got something for you. Zapier now allows us to share Zaps. That's a super cool feature I wasn't aware of (until now). You probably will have to change one or two things but here is the end product I created for this post.

BRING ME TO THE THING NOW

If you don't have an account go ahead and create it, we're going to need it :)

Make a Zap

First, you're going to need to create your Zap.

make a zap

Trigger

You need to select the trigger. A trigger is the app + event combo that will start the Zap.

In our case, we'll select Strava.

select trigger app

Then you can choose what event should start the Zap. We want to use New Activity.

select trigger event

You will be asked to log into your Strava account. Mine was already linked!

link strava account

Then, you can test the trigger. Zapier will pull the last event of this type and display the payload content. All those information will be available in the next step.

test trigger payload

Action

Now that we have a trigger, we need to choose what we want to do with it. I found that I always end up posting to Slack. This might be because my use cases are a bit trivial but you can come up with much more complex flows.

Here, you're asked to select which app will react to the trigger. You could push your data into a spreadsheet to compile your results and maybe even pull the weather and find some sort of correlation between the temperature and your pace šŸ™ƒ. Sky's the limit!

For now, let's just show off to our colleagues. So I'll pick Slack.

select action app

For the event, we want to submit to a channel. I suggest selecting Direct message to debug the Zap before sending it to a channel.

āš ļø I don't recomment sending your results to any a public channel such as #general āš ļø

select action event

As before, you will be asked to log into your Slack account. Mine was already linked (again)!

link slack account

Configuration

Here comes the fun part. This is also the part where you can go off-script if you'd like. These are just my personal preferences.

The message builder is quite intuitive. Try it! If you're too lazy you can always use the zap sharing link I've put at the top of the article.

I picked the name of the activity, the distance, the duration, the pace and the URL (so people can go five me kudos šŸ˜). Also, I picked Send as a bot. But feel free to do otherwise.

configure zap

Also, I didn't like having the Zap link at the end of the message. Plus, we get the event emoji from Zapier. Let's use it.

advanced config

If you want to tag someone you will have to enable Link Usernames and Channel Names feature. Also, check this if you want to learn why @username doesn't work. You will have to dig a bit for that šŸ™ƒ.

I highly suggest that you tag yourself so people know who's the activity owner

In my case, I could do that by adding <@UB7L6HMUL> to my message.

link username

Release it

Woops, don't forget to activate it šŸ™ˆ. turn it on

Zapier only collect/submit event in a while (unless you're on a paid plan). So don't worry if it takes a few minutes for the event to appear in Slack.

Conclusion

Here you go, you did it! Congrats :) Feel free to try out other triggers and action combinations.

see the result

Hey there šŸ‘‹

I hoped you like this little sample of my brain šŸ§ . If you have any questions, please reach out šŸ™

Marc-Antoine Ferland

About

Hello, I'm Marc-Antoine. I absolutely love crafting elegant solutions to a wide array of problems. I'm fascinated by theory-crafting and I will love challenging the status quo. I love efficient and people-driven cultures. Work should adapt to your lifestyle, not the other way around. I'm currently a Senior Frontend Engineer at Capdesk šŸ’»āœŒļø