A few weeks after the fantastic Tableau Conference in New Orleans, I received an email from a data scientist who attended my TC18 social media session, and who is using Azure+Tableau. She had a quite interesting question:How can a Tableau dashboard that displays contacts (name & company) automatically lookup LinkedIn profile URLs?
Of course, researching LinkedIn profiles for a huge list of people is a very repetitive task. So let’s find a solution to improve this workflow…
1. Python and TabPy
We use Python to build API requests, communicate with Azure Cognitive Services and to verify the returned search results. In order to use Python within Tableau, we need to setup TabPy. If you haven’t done this yet: checkout my TabPy tutorial.
2. Microsoft Azure Cognitive Services
One of many APIs provided by Azure Cognitive Services is the Web Search API. We use this API to search for name + company + “linkedin”. The first three results are then validated by our Python script. One of the results should contain the corresponding LinkedIn profile.
3. Calculated Field in Tableau
Let’s wrap our Python script together and create a Calculated Field in Tableau:
4. Tableau dashboard with URL action
Adding a URL action with our new Calculated Field will do the trick. Now you can click on the LinkedIn icon and a new browser tab (or the LinkedIn app if installed) opens.
Is this useful for you? Feel free to download the Tableau workbook (don’t forget to add your API key), leave a comment and share this tweet:
— Alexander Loth (@xlth) February 1, 2019