Summary: this post will show a code-free way to have specific tagged Yammer posts also posted to a specific team channel in Teams using Flow.
This is not a post to convince you to use Yammer versus Teams or vice versa... by now everyone should know that this "journey" is not a matter of alternatives but a matter of options.
Office365 delivers us several tools which could be used for several scenario's and therefore some tools are similar in functionalities usable for the same scenario. Which tool to use for which scenario??? Let your team and experiences decide!
I can think of multiple scenario's where a team is part of a bigger organization that uses Yammer and instead of checking all of Yammer groups and posts, this team would want to be notified (and start discussions in their own team) about one or more specific topics being posted on Yammer.
In my example we have created a Team in Microsoft Teams: Team-Portiva Fun and this team wants to know if a post has been created in Yammer with the tag #allofportiva. The way they want to be notified is by receiving a post in their General channel, so they can discuss it in their team first and secondly quickly visit the Yammer post (to reply for example).
When writing this blog post, Teams has not been released for long and Flow is getting updates weekly, so in time I expect this to be made even easier... For now let me show how I achieved this with the help of Stefan Stranger his post "Use Microsoft Flow to send a message to Microsoft Teams":
- Determine the tag you would like to be used in Yammer
In my example I chose the #allofportiva tag
- Enable your desired channel in Teams to receive posts.
This is done by adding a connector:
of the type Incoming Webhook:
- Give it a name which everyone will recognize:
you can even give it an own image to add its recognizability!
- After creating the connector it will appear as one of the configured connectors for this specific channel:
Save the URL belonging to this connector for next steps:
- Now we can create a Flow (from scratch) and (at the moment) we have two options as a starting trigger from Yammer:
Of these options I chose the Following feed (because I follow everything) to make sure it will check through multiple Yammer groups.
- I created a Flow with the following steps (which I will explain in detail off course):
- Flow does not (yet) have the traditional way of adding variables as we had in SharePoint Designer. It does however have the Date Operations - Compose action in which we can achieve similar results in the form of dynamic content.
In this action I combine multiple dynamic content from the first step; because this is a Yammer trigger, we have some Yammer post info available. As you can see we can add HTML coding to add information and determine the layout.
- I added a Send e-mail action for troubleshooting purposes and to see if Flow really works. Guess what...... it really works!
- I added a Delay because in Flow (and many other Microsoft related workflow tools) this often prevents issues (if it does not help, it certainly will not hurt)
- Then the Condition which determines when to post to Teams (pretty self-explanatory)
- I added another Send e-mail action to see if the condition works correctly.
- Then last but not least the HTTP -HHTP action which does the posting to Teams using the Incoming Webhook URL from Step 4:
One thing to note is the Body which is "a simple JSON payload". For a noob like me who can hardly spell HTML and CSS, this was do-able with the help of some research on the syntax (https://dev.outlook.com/Connectors/Reference).
IMPORTANT: to use variables from previous steps in Flow for this Body, you need to delete the last curly bracket or else Flow will not show the popup to select variables:
after adding all the desired variables / dynamic content, just add the curly bracket at the bottom again and everything is fine.