Fun with Flow: Karaoke Buddy
Have I told you lately how much I love Microsoft Flow? I’ve blogged about it in the past, mostly for business use cases but there are so many just plain FUN things you can do with Flow too. I got to thinking about one of my favorite shows, Big Bang Theory and how Sheldon has his “Fun with Flags” video series. Any other Big Bang Theory fans out there? So I decided to start a new blog series called “Fun with Flow”.
In this edition of Fun with Flow I wanted to combine my love for Flow with my love for karaoke. The hardest thing about karaoke is figuring out what song to sing. I was talking to my friend Daniel Laskewitz about this and he came up with the genius idea to create a Flow to pick a random karaoke song for you. If you aren’t following Daniel on Twitter and reading his blog you are missing out guys, seriously follow him!
Setting it Up
I figured the easiest way to get this going was to use a SharePoint List to store my selection of songs. So, I created a list in SharePoint called “KaraokeSongs”. In addition to the Title column, I added Artist, Genre and Song Type (Solo or Duet) Columns. I populated this list with some of my favorite go-to karaoke songs as you see here:
Now is where the fun stuff comes in…
Building the Flow
For this use case, all I really want is to be able to push a button on my mobile device and have it pick a random karaoke song for me. It would be nice if I could also have a dropdown to select if I want it to pick a Solo song or a Duet and maybe even be able to select the genre I want to sing. I don’t know about you but this seems like the perfect use case for a Flow Button!
The first step is to create a new Flow using the Flow Button for Mobile Connector. Next, we need to create our inputs for the button. For this I want two inputs: Type which is a drop-down with Solo or Duet as the options. Genre which is a drop-down with Pop, Rock, Rap and Country as the options.
Now that the button trigger is set up, we need to get the list of songs from SharePoint. To do that, we will insert a Sharepoint – Get Items Action. Just point that to the site and list where your song list is stored. We will want to include a Filter Query so that we only get items from the list that match the selected Song Type and Genre. We can do that with the following formula as shown in the screenshot:
The next step is find a random item from the SharePoint Get Items results. Luckily, there was a great blog post by Paul Keijzers which walks you through how to get a random item from SharePoint which you can reference here: https://sharepoint-specialist.nu/how-to-get-random-item-from-a-collection-using-microsoft-flow-to-post-a-message-to-twitter-teams-534c3265495e
To get the random item we need to insert a Compose Action and set the Input to the following expression:
Next, we need to insert two Initialize Variable Actions. We will create one variable called “SongTitle” and another called “Artist”. You’ll need to set the values of those to outputs(‘GetRandomSong’)?[‘Title’] and outputs(‘GetRandomSong’)?[‘Artist’] as seen in the screenshots below:
The final step is to add a Send Mobile Notification Action with the following text:
Karaoke Buddy Finished Product
Now let’s see how it works on the phone:
Advanced Configuration Options
For this fun with flow post I took the easy way out by using a SharePoint list. The cool thing about this app is there are lots of ways to add on to it. For example, you could create a custom connector to the Spotify API to pull songs from your favorite karaoke playlist. There’s also a pretty cool PowerShell Module for connecting to Spotify that you could check out here: https://github.com/bmsimons/ps-spotify . With this module you could pull a playlist and populate your SharePoint list automatically.
For now, Karaoke Buddy does exactly what I need but who knows, in another blog post maybe I’ll expand on it and pull random songs directly from a Spotify playlist.