Ah, music!

There’s nothing like some great music to help you focus on work, stay in a state of flow, and get stuff done. Here’s something fun you can do with your team: you can wire stuff up with Flow, so your peeps in Teams can all come together to build a common Spotify playlist which plays on a set of speakers in the open-office area where your team works! You can also fire up this playlist at a morale event, a product/release ship party, holiday party, or on a Friday afternoon to lift everyone up.

This article shows you how to get this going.



Skill level required: low.

Excitement level generated: high.

Ready?!

Here’s what will happen once you’ve wired everything up.

Anyone in your team would be able to go to the “Community Playlist” channel, or whatever you want to call it, and share a Spotify song link.

This song will magically 🌟 get added to the Spotify playlist that’s playing on a set of speakers in the common area where your team works!

OK, excited to figure out how to make this work?

If you are impatient, just grab this Flow package and import it. Follow the prompts.

Psst, to import… just go to https://flow.microsoft.com and tap on Import in the top ribbon.

How does this Flow work, you ask?

Here’s the overview.

Let’s break it down!

“When a new channel message is added” piece is our trigger. There’s nothing very exciting here, except that, this is where you specify the channel in Teams that should be monitored for new messages. This is the channel you’d ask your team to share the Spotify songs to. The interesting stuff follows this step.

BTW, here’s a cool tip: this trigger is a pretty powerful way to easily light-up a bunch of scenarios for triggering things in other systems based on stuff posted in Teams. Think about that. 🤔

“Parse out Spotify song URL” is slightly more interesting. This is where we do some Flowjitsu™ to parse out the URL to the Spotify song in the message. Nothing extremely fancy here, than to just find the index where the Spotify URL starts and rip out the complete Spotify URL to send off to the next step.

“Build a Spotify song URL” This is straight-forward as well. The only minor tricky thing here is to realize that the next step for adding tracks to playlist requires you to send URIs of the form “spotify:track:<bla>” so we do some simple string replace.

“Add Tracks to Playlist” is straight-forward as well once you’ve got the rest of the steps right. It receives the “spotify:track:<bla>” URI from the previous step, and needs to be given the ID of the Spotify Playlist to add the song to. You can grab that using the Spotify client via the … next to the playlist name as shown here.

👉 Go ahead, try it out! Go to the channel you decided on, and paste a Spotify song link you get in the following manner.

… next to a song, tap Share and then select “Copy Song Link”

It should get added to the Spotify playlist you configured.

And that’s it! Done! Go show off to your team! 👍

You are welcome!