09-06-2016 11:18 AM
09-06-2016 11:18 AM
When someone joins a Yammer network, and that network has fewer than 20,000 members, then a message is created in the All Company group welcoming that person to the network. There is no administrative control over this messaging – you cannot turn it off, you cannot change the text, and you cannot put those messages into another group, leaving your All Company often cluttered with these messages.
At least, you couldn’t before you found this article. :)
The secret is to use Flow, which was released as a preview on April 29, 2016. This preview has just enough hooks into Yammer that we can accomplish this long-asked-for task.
There are two Flow hooks into Yammer as an event – two Yammer-specific “triggers”. The first is a post in a group, and the second is a post in your following feed. The first trigger doesn’t help, because the All Company group is a special group, which does not have an identifying number associated with it. It’s in the second trigger that makes magic happen.
And let me start by saying you do NOT need to be a hotshot developer to do this. The directions are long-winded but you CAN do this. Some bits are a little tedious but honestly, this is doable for any Community Manager or Yammer admin.
First, you’ll need to prepare by choosing the group where these messages will go. For this demonstration, we have created a group called All Yammer Users. Go to Yammer and create / select the group where these are going. Also, follow the #Joined topic in your network. (This must be done as a Yammer Verified Admin)
Next, you need to sign up for Flow by accessing the Flow site. Go ahead and sign up.
At the top of the Flow page, hit “My flows”, and then select Create new flow.
See? Not scary, right? So it asks you how you would like to start. Well, we want to start with Yammer. And, sigh, yes, it is all the way at the bottom. Choose the very last item – Yammer – When there is a new message in my Following feed.
You’ll be asked to authenticate to Yammer – just put in your username and password when it prompts you. (It’s all Microsoft and you’re logging in to Microsoft; you don’t have to worry about compromising your security with this.)
Ok, so that looks promising. And a little confusing. Hit the little + symbol beneath the blue Yammer bar.
It asks you to choose between adding an action and adding a condition. For now, you need to add a condition.
When the black condition box opens up, just click inside the “Object Name” box and right below it two little blue boxes will appear. Click on the second one, “Message Text.” On Relationship, click the down arrow and select “Contains”. And then on the Value, enter, “network. Take a moment to welcome” (no quotes). Here’s a screenshot:
Notes: First, the value is going to be different in each language. Take a look at your #joined messages, and enter the exact words and punctuation used in your #joined messages. These instructions are for US English, which uses this text, including one space between the period and the next sentence. Use the exact phrase used after your network name and before the individual name. Second, don’t worry, we’re going to test, you’re not going to break anything. You can always make adjustments later.
Ok, so now we have a trigger, we have a condition, now we need an action. Our action is to re-post the #joined message into the All Yammer Users group (or whatever group you choose).
On the “If yes” side of the screen, below our black condition box, click the purple “Add an action” button. It asks what you would like to do next, and to nobody’s surprise, Yammer is again listed last. (Ok, it’s alphabetical but still.) You’ll have to hit “Load More” to get all the way down to where Yammer stuff is. Select the very last item, “Yammer – Post message”
Now you’re asked what you want to post. Here’s another little trick. The #joined messages are posted by the new user, so you know who they’re talking about. But these messages are actually going to be posted by you. So you have to somehow indicate who the person is who joined. Good thing that information is here. We’ll give the user ID – the internal number of the account that just joined us. It’s there. And we’ll make it clickable like a normal account by putting two brackets around it. Here, take a look at the screenshots below. Start by clicking within the Message Text field, and then clicking the ellipsis (…). Type “[[user:”, then click on the sender_id, which puts that box in. Then click back in the Message Text box and type type “]]”. Finally add text that you would like to include in your post.
The brackets are how the user name gets to be clickable, and to show up even in a moble app. Ok, that was kind of out of the comfort zone, right? Well the next thing is easy. Click on Group ID and choose the group we’re sending these messages to.
Ok, so let’s see if that works. At the bottom of the page is a box labeled, Flow name. Put in a name for your flow and click Create Flow. Again, don’t agonize over the name; we can change it later. It’ll ask you if you want to submit it to the gallery (publish to the world). Let’s not, just yet. Click Done, then Manage.
Now it’s listed in “My flows”, and it’s running! The next person that joins your network will have the notification show up in both groups. We haven’t done the delete bit yet. If it doesn’t work, click on the little i symbol and it’ll show all the logs for it running (or not running). Review the article and make sure you got everything in place. And make sure that you’re actually following the #joined messages, or it won’t work at all, guaranteed.
Ok, now we didn’t want to just copy the messages – we wanted to MOVE them. Which means we need to delete the original after we make the copy. To do this, we need something called a REST token. Two things to know about this.
First – be careful with this token. Guard it. It’s the security equivalent of your username and password. And since you’re a Yammer Verified Admin, someone finding and using this token could really be a big problem for your network.
Second – this process is a pain. Seriously. I’ll try to write a script to make it easier, but for now, unfortunately, the best available documentation is here: https://developer.yammer.com/docs/test-token
I’ll wait while you read that. And yes, like I said, it is a pain. Sorry.
When you’re done, you’ll have your token. It’ll be something like this: GwrtnFHPU59EL1CUFeuEbe
Ok, that is literally the hardest part of this whole process. Don’t be embarrassed asking for help from your local developers or the Microsoft Tech Community Yammer Developer group.
Now that you have your token, we can add the action to delete the message after we copy it. Go back into Flow, sign in, and click on My flows. Click on the flow we’re building, which will open it in edit mode. What we want to do is make a new action under the same condition, which means don’t click the + symbol. Instead, click the Add an action button on our If yes box, which currently has Post message in it.
This time, select the 3rd item down, “Http”. It’s orange. 4 boxes will open up asking you to fill things in. Fill them out exactly this way:
The Method is a drop down – select DELETE.
For Uri, enter https://www.yammer.com/api/v1/messages/ and then click Message ID below the box, which will enter it into the same line.
For Headers, the punctuation is critical. Here it is for you. This is where you use that token that you went through so much trouble to get. Do not use the <brackets>, but use all the other punctuation. For this example I’ll use the example token I used above, but you gotta use your own.
"Authorization": "Bearer GwrtnFHPU59EL1CUFeuEbe",
What we’re doing here is you’re making a call to the Yammer API and telling Yammer that you’re you (with that token) and saying that as you (a Verified Admin), you’d like to delete the message that triggered this flow (which is a #joined message). That’s why I broke the narrative earlier in the instructions to allow you to test, because this will delete any message that sets the trigger. And no, you can never get it back; the message is gone. So make sure the copy operation works before you put this step in.
Ok, that’s it. Update the name of your Flow, and click the Update Flow button. You’re done! That’s it, the flow will run (as you) until you come back here and pause it with the pause button (||). You can edit it any time by clicking on the name, and again the i symbol holds the logs of when it ran, when it failed, and why. Delete with the trash can (but why would you?!)
I’ve also tested some flows that put information about the joiner into SharePoint so that you can keep a running log of activity within Yammer in a central repository, but that’s for another day. Enjoy!
(Originally posted on the Office 365 Network 17 May, 2016. Note that this version corrects a previous version which reposted the same message, thus creating an endless loop condition. Screenshots may look different as Flow iterates.)