Build it with Microsoft Flow: Get a notification when a “watch word” is mentioned in Yammer

yammerIf your organization uses Yammer to drive information sharing and employee knowledge transfer, you have a potential treasure trove of great content. But staying up-to-date on Yammer conversations can be tough, particularly when you’re running from meeting to meeting. It’s easy to miss key Yammer posts, even if you subscribe to email notifications.

Fortunately, Microsoft Flow can help! Let’s say you want to monitor a particular Yammer group for one or more “watch words.” When a message that contains the watch word is posted on Yammer, you’d like Microsoft Flow to send you an email notification. This functionality enables you to audit Yammer groups for the content you’re most interested in.

Here’s an overview of what this flow looks like:

Yammer watch word-01.png

And here are the steps to re-create the flow:

  1. Create a new flow from blank (aka not from a template).
  2. Add the trigger When there is a new message in a group.
  3. In the Group Id field, select the name of the Yammer group you want to monitor.
    Note: This flow doesn’t monitor multiple Yammer groups at once; it triggers to run when a new message is posted in a single Yammer group. If you’d like to run this watch word flow across multiple Yammer groups, you’ll need to copy your completed flow and create a new flow for each group you want to monitor. The process for copying your finished flow is provided in step 15. 
  4. In the Network Id field, select the name of your Yammer network.
  5. If you’d like your watch word email notification to include the name of the person that posted the Yammer message, add the Get user details action. In the User ID field, add the Message List Message Sender field.
  6. Add the Get my profile action. This action obtains the SMTP email address for the current user (e.g. john.doe@mycompany.com). You’ll use this SMTP email address to configure your email notification.
  7. Add a Condition action.
  8. In the Value field, add the Message List Message Body Text field.
  9. Change the is equal to field to contains.
  10. Type your watch word(s) in the Choose a value field. In the example flow shown above, my watch word is PowerApps.
  11. Add an action in the If yes box. Since I wanted to send an email notification when my watch word was used, I added the email action.
  12. In the To field of your email, insert the Get My Profile Mail dynamic content.
    Note: You may need to select “See more” under the Get my profile header to see the Mail content.
  13. Add additional details for your notification (e.g. subject line, email verbiage, etc.).
  14. Save and test your flow.
  15. Optional. If you’d like to set up your watch word flow for a second Yammer group, follow these additional steps:
    1. Go to your flow’s information page.
    2. Click on the More dropdown and select Save As.
      Yammer watch word-02.png
    3. Specify a name for your copied flow and click Save.
    4. Return to your My Flows page and edit your newly-copied flow. Update the Yammer group identified in your trigger, save the flow, and turn on the flow.
    5. Repeat step 15 for each Yammer group you want to monitor.

Now that my flow is built, I receive an email notification like the one shown below each time the watch word PowerApps is mentioned in my Microsoft Flow Yammer group:
Yammer watch word-03.png

Sharing your new flow:
Now that you’ve created your flow, it’s time to think about sharing it with others in your organization.

Credits (and a few words of encouragement):
If you’re working with Microsoft Flow and are having a hard time figuring out how to build the workflows you need, don’t despair! When I first started trying to build this “watch word” flow, I got completely stuck. I couldn’t figure out how to build it without complicated formulas or JSON. Many thanks to Jon Levesque, Marcel Haas, and many others on Twitter for jumping in and teaching me a better way to go about it!

Using Microsoft Flow & Azure Cognitive Services to automate sentiment analysis of Yammer posts

yammer sentiment flow-14

As an Office 365 product manager and corporate evangelist, I’m responsible for engaging users and driving adoption of Microsoft Collaboration tools. Measuring the saturation and use of Office 365 is a key part of my role. Yes, I regularly review Office 365 usage metrics for high-level trending. But metrics alone don’t tell the story of user satisfaction and adoption. In order to build better training and adoption programs, I need to understand why my dedicated users love the tools and why others remain resistant.

Many companies rely on surveys to gather end-user feedback. While surveys are useful for gathering specific types of quantitative data, surveys are one-dimensional. You can’t dynamically ask follow-up questions to learn more about specific survey responses, and you can only capture a limited set of data points. Innovation games enable you to gather a much broader set of quantitative and qualitative user data, but require an investment of time to facilitate games and distill the results. For best results, I recommend a multidisciplinary approach that leverages Office 365 usage statistics, user survey responses, innovation games data, user testimonials, etc. to measure user satisfaction. 

With the release of artificial intelligence (AI) and machine-learning algorithms, we also have the ability to gather user sentiments automatically. If your organization uses Yammer to drive employee engagement and empower open dialogue, you have a wealth of user data that can be analyzed. With Azure Cognitive Services and Microsoft Flow, you can perform automated sentiment analysis of your Yammer group posts. Sentiment scores for each Yammer message can be stored in SharePoint and visualized for trending analysis via Power BI. You can even send push email notifications to your Office 365 administrators or Corporate Communications team when strong positive or negative messages are posted in Yammer.

Chris Bortlik, Principal Technical Architect for Microsoft, recently shared a blog post on Yammer sentiment analysis. I used Chris’ model, with a few modifications, to gather and report on Office 365 user sentiment.

The scenario:
My organization leverages a Microsoft Flow Yammer group to foster employee conversations and questions/answers about flow. We want to monitor the Microsoft Flow Yammer group using sentiment analysis so we can:

  • Identify negative flow Yammer posts that require follow-up
  • Identify positive Yammer posts that can serve as user testimonials or references
  • Define trends in our Microsoft Flow Yammer posts (e.g. daily/weekly/monthly positive and negative trends, overall positive or negative sentiments for flow, etc.)
  • Validate the success of our Microsoft Flow education and adoption program (e.g. confirm we’re seeing growth in the volume of positive flow Yammer posts over time)

The setup:
Follow the steps outlined below to set up automated Yammer sentiment analysis.

Step 1: Confirm you have a Cognitive Services Text Analytics Account. In order to set up this solution, you will need a Cognitive Services account key and a root site URL.

Step 2: Create a SharePoint list to store your Yammer sentiment analysis scores. Flow will create a new item in your list for each Yammer message it analyzes. Here’s a list of the custom columns I added to my list:

  • Score – Number column; stores the sentiment rating for each Yammer message
  • Message link – Hyperlink column; stores a link to the rated Yammer message
  • Posted by – Person/Group column; stores the name of the person that posted the Yammer message
  • Thread ID – Single line of text column; stores the Yammer thread ID for the message. Enables you to sort, filter, and group sentiment scores for a given Yammer thread (including original message and replies).

Azure Cognitive Services will provide a numeric sentiment score between 0 and 1 for each Yammer message it analyzes. The more negative a Yammer message is, the closer to 0 its score will be. More positive messages will receive a rating closer to 1.

Here’s a screen shot of my SharePoint list. Each list item represents a rated Yammer message:
Yammer sentiment flow-11.png

Step 3: Identify the Yammer group you want to perform sentiment analysis on. You can set up sentiment analysis for multiple Yammer groups, but each will require a separate flow process. I also recommend setting up a different SharePoint list to hold sentiment scores for each of your Yammer groups. (Having different SharePoint lists enables you to set up different trending reports on Yammer group sentiment.)

Step 4: Create your Microsoft Flow. I created my flow from scratch (not using a template). Here’s a quick breakdown of the flow conditions and actions:

  • When there is a new message in a group – Detects when a new Yammer message is posted in my Yammer group
  • Get user details – Pulls Yammer user profile details. (Enables us to capture the full name and email address for the person posting the Yammer message.)
  • Detect Sentiment – Calls the Azure Cognitive Services API so it can calculate a sentiment score for the Yammer message
  • Create item – Creates a SharePoint list item for the Yammer message being analyzed
  • If the comment is negative – Sends an email to my Office 365 admin team if the sentiment score for a Yammer message is ≤0.3.
  • If the comment is positive – Sends an email to my Office 365 admin team if the sentiment score for a Yammer message is ≥0.7.

Step 5: Create Power BI report(s) to visualize your Yammer sentiment scores. Published reports can be rendered in your SharePoint Online Communications or Team sites using the Power BI web part. For help in setting up sentiment analysis slicers, check out this DataChant blog post.

Here’s a sample dashboard that shows Yammer sentiment data for my Microsoft Flow Yammer group:

yammer sentiment flow-14

Step 6: Distill the results. Once you start calculating Yammer sentiment and have reports to visualize the data, you can analyze the results and follow up where needed. Here are a few ideas to get you started:

  • Break down negative Yammer posts (e.g. posts with a score ≤0.3) by user. Schedule follow-up meetings with Office 365 end-users that consistently post negative messages. The goal is to ask questions and understand the pain points the users are facing. Perhaps they have hardware or network issues that impact their productivity. Or maybe they’re having issues with Microsoft Flow and need a coach/mentor to spur their learning. Having one-on-one dialogues provides the opportunity for candid feedback and enables you to make a difference in the user’s productivity and technology experience.
  • Identify Office 365 enthusiasts. Break down Yammer posts by volume or by high sentiment average in order to find power users across your organization. Set up meetings with these enthusiasts to understand how they leverage Office 365. Incorporate them into your user group or internal community and support them in their growth. These enthusiasts can become your Office 365 evangelists!
  • Monitor the volume of Yammer posts in your group. Build a gauge that shows your number of Yammer messages month-to-date and identifies progress towards your monthly Yammer message goal. Keeping an eye on your total posts month-to-date and year-to-date will help you monitor use over time and highlight areas you may need to invest additional time and adoption efforts in.

yammer sentiment flow-15

  • Optimize your communications. If one of your Office 365 admin resources has consistent negative Yammer sentiment scores, have them evaluate the verbiage they’re using. Slight wording changes can change the tone of their messages, increasing Yammer sentiment scores and better engaging with end-users.
  • Take a health pulse. Build trending visuals that show average post volumes and sentiment averages by week or month. If you start seeing spikes on volume of posts and/or significant changes in your sentiment averages, it’s time to dig deeper. Perhaps you’re seeing a spike in interest in PowerApps after a compelling user group presentation or have network bandwidth issues that are causing issues. Either way, Yammer sentiment analysis can be your early warning indicator that something has changed.

It’s not about the technology. It’s about the use case

This week, I participated in a REgarding 365 debate about use of org-wide Microsoft Teams. Not surprisingly, the Microsoft Teams versus Yammer question was raised multiple times. Here’s the thing–there are uses for Microsoft Teams (including org-wide teams) and there are uses for Yammer. In the end, it’s not about which tool myself or the other REgarding 365 panelists prefer. The valid questions are:

  • What are your organizational use cases and content needs?
  • What is your company culture?
  • Which technologies best fit your use cases and culture?


Use cases are practical business needs (aka requirements) that need to be met. Examples of use cases include:

  • Sharing organization-wide HR policy changes
  • Sharing strategy and content updates from the company’s CEO
  • Providing newly-onboarded employees with a resource center for frequently asked questions
  • Enabling employees to instant message, chat, and screen share with their peers
  • Enabling employees to quickly engage with other employees and members of IT on technology support questions

As collaboration strategists, our first job is identifying and documenting the unique use cases for our organization. Next, we need to assess our organizational culture, including: company values and norms; technology adeptness (aka how well our users adopt new technologies); and readiness for change (e.g. do our users welcome change or do they fear it?).

When we view our use cases alongside our company culture, we’ll be able to determine which technologies are best-suited to meet our needs. There is no one-size-fits-all model or one Microsoft 365 capability that wins the day. Let’s look at our organizational use cases and culture and determine what tool works best for our specific needs.

Choosing between the classic and modern Yammer web part

UPDATE: Just announced at Ignite–Microsoft is planning a Q1 2019 launch of the new Yammer Conversations web part. Yammer Conversations will embed a modern view of your Yammer group in SharePoint Online. Users will be able to like and comment on Yammer posts directly within the SharePoint web part (no more having to open Yammer in another browser window), or using the SharePoint mobile app. This new Yammer Conversations web part will not replace the current “modern” Yammer web part. The existing modern web part will be remain in place as the “Yammer conversations highlight.” The highlight web part renders Yammer data within SharePoint Online in a read-only view.

If you’re using Office 365 and want to integrate a Yammer web part into your modern SharePoint site, you have a choice to make. You can use the classic Yammer web part that leverages embed functionality with an older look and feel or use the updated modern Yammer web part. Microsoft doesn’t make this an easy choice, as both web parts have some big advantages and drawbacks. This post breaks down the pros and cons of each web part and provides guidance on how to choose the best Yammer web part for your needs.

To help us get started, let’s take a look at the modern and classic Yammer web parts side-by-side. The screen shot below shows the modern Yammer web part on the left and the classic Yammer web part on the right. The web parts are displaying data from the same Yammer group, but the look and feel is entirely different.

Yammer web part 07

The modern web part displays each Yammer post as a card (or tile). The visual view clearly demarcates each post, but the boxy display makes it harder to scan the content. The classic web part displays all posts in chronological order using a vertical scroll bar. While the chronological display makes the content easier to scan, the vertical scroll bar makes the web part look antiquated.

The usability of the modern and classic Yammer web parts are very different. The modern web part only includes a visual indicator for likes and comments. If you want to see details or comment on a post, you’ll need to click on the Yammer “tile.” Office 365 will launch Yammer in a new browser tab, enabling you to add likes and comments. The experience of spawning a new tab to interact with each Yammer post is jarring at best.

The classic Yammer web part offers a full-fidelity experience. Yammer likes and comments are displayed in a traditional threaded view, and users are able to like posts, add comments, and create new Yammer posts directly in SharePoint (no additional browser windows required).

Display options
The configurable display options for the classic and modern Yammer web parts are also different. The modern web part provides 3 choices for content display:

  • Top conversations: Displays the most popular posts in your Yammer group
  • Latest conversations: Displays the Yammer group’s newest or most recently liked/commented on conversations
  • Only conversations you choose: Displays the specific Yammer posts you specify. (You will need to copy and paste the Yammer conversation URL for each post you want to display)

Unfortunately, no options are provided to alter or customize the tiled display for the modern Yammer web part.

The classic Yammer web part displays all posts in a single vertical scroll list. The sort order is strictly chronological, and is based on the Yammer post creation date/time. The only display option provided for the classic web part is vertical sizing of the web part itself. The choices are incredibly limited (you can choose small, medium, or large). Unless you’re greatly limited on SharePoint page space, I recommend the large display. The small and medium options cause massive vertical scroll bar fatigue.

Mobile display
The mobile SharePoint app experience is also unique. The modern Yammer web part renders well in the SharePoint mobile app (as shown on the left below). The classic Yammer web part doesn’t support the SharePoint mobile app, so classic Yammer web parts will render as a blank grey box. Carefully consider whether mobile SharePoint access is important for your users. If mobile access is important, the modern Yammer web part is your only option.

Yammer web part 09        Yammer web part 08

Choosing “classic” or “modern”
In the end, usage of the classic or modern Yammer web part comes down to a couple of key trade-offs. To help you narrow down the choices, take a look at the summary table below. Bottom line: If SharePoint mobile access is important, the modern Yammer web part is the only option. If mobile access isn’t a priority (or is seldom used), I will often use the classic Yammer web part because it supports liking and commenting on Yammer posts directly within SharePoint.

Yammer web part 10

Setting up the modern and classic Yammer web parts
The setup process for the Yammer web parts is a little cumbersome, as both the modern and classic Yammer web part display options are incorporated within a single Yammer web part. When you add the Yammer web part to your modern SharePoint page, the web part configuration tab will appear. You’ll need to start by typing in the name of the Yammer group you want to display posts for. (Note: There is no option to display posts from more than one Yammer group within a single Yammer web part. You’ll need to use multiple Yammer web parts if you want to display posts from more than one Yammer group.)

If you want to use the modern Yammer web part, select from the three conversation display options provided (top conversations, latest conversations or conversations you choose). If you want to use the classic Yammer web part, select the hyperlink “Use the classic version of Conversations” (highlighted in yellow below). The web part configuration tab will refresh, and you’ll be prompted to specify a display size (small, medium, or large) for your web part.

Yammer web part 02