Site icon @WonderLaura

SharePoint News Notifications in Teams

Yesterday at our Birmingham SharePoint and Office 365 User Group meeting, we had an informal open discussion about Microsoft Teams.  Nick Brattoli and I lead the discussion, with demos of Teams, and talked about best practices and adoption.  We asked a lot of questions to the group, about how they currently use it, what end users are doing in there, and any roadblocks to adoption.  The discussion and idea sharing was awesome.  We talked about the idea that Teams is really for intimate collaboration among groups of people, around things such as projects and for teams who work closely together.   Inherently, of course each Team that you have is also an Office 365 group, which is also a SharePoint site.  There does seem to be some confusion around a few things, like when to use Teams versus other things.  So then the question was asked “What do we use SharePoint for, if we’re getting the end users to use Teams?”.

There are several answers to that question, but the first thing I jumped in with, is that SharePoint is your intranet.  An intranet is where most users are reading information like news and departmental topics.  It’s mostly one-way information posted by communications departments and individual departments.  If users are in Teams all the time, you can still show them your SharePoint pages, too.  One way, is to add a new (SharePoint) tab in your Teams channel, that shows a page from that site.  Notice that even if you do not have a page called “News” in the site pages library, you can still pick it here, and it will display all of your news from the site.  Also, keep in mind that if the users have installed the SharePoint mobile app, they will receive notifications about News, from the app.  (and the news author will receive notifications about comments on their posts as well)

Also, if you’d like to show news from your main intranet homepage, not just a page from the current site, you can use a tab called Website.  You can just use the URL to any page/site in your intranet.

In either of those cases, users can click the tab in Teams to take a look at the news / what’s posted on the home page.  But, that doesn’t address the concept of users being notified about content there, like new or updated pages.  Here’s where my solution comes in.  There’s a new Microsoft Flow action for Teams, called Post your own adaptive card as the Flow bot to a channel.  This will let you create a pretty, customized announcement / notification that will appear in a Teams channel.  I wasn’t sure what an adaptive card was, but decided to try it out. Remember, I’m not a programmer.

Just to keep it simple, I’ll start by showing you how to use this action in a Flow, just with a manual trigger, just starting with one of the out-of-box templates.

 

1.  Go to your Site Pages library where the news is that you’d like to post to Teams.  Click the Flow menu at the top, and choose Create a Flow.

 

2.  Choose Post a message to Microsoft Teams for a selected file. This will open up the Flow for you to configure further.  Delete the action called Post message.

 

3.   Add the Microsoft Teams action called Post your own adaptive card as the Flow bot to a channel.  Pick the Team and Channel where you would like to post the notification.  There are two differences here.  First of all, you are configuring the layout using JSON instead of HTML, also the message will be posting as the Flow bot, instead of as the user who triggers the Flow.

 

4.  This is where it gets fun.  I went to this site with Adaptive Card Samples, and picked this one called “Restaurant”.  Optionally, if you’d like to change a few things and tweak this template, you can click the button Try it Yourself.

Here is the Adaptive Card Designer:

Once it visually looks the way you want it, the next step is to bring it over to Flow, to put your SharePoint information in there.

Click the button at the top of the page Copy JSON.

 

5.  Go back to Microsoft Flow.  In the Message box you saw at step 3 above, paste the JSON code.  Using dynamic content from Flow, insert the information about the news, that you’d like to be displayed in the card.  See, here I’ve inserted the Title, first published date, Description, Banner Image URL, and also Link to Item.

 

6.  Save the Flow, and try it out.  Go to your site pages library, and select a row. At the top, click the Flow menu, and choose the name of the Flow you just created, Post a message to Microsoft Teams for a selected file. Continue, type a message, and click Run Flow.

Over in Teams, here’s what appears.  When I click the More Info button, it takes me over to that page in the browser.

Here’s the exact Flow that I used, that you can download and try with your own site and Teams.

Here’s a recommendation.  Tie this posting of the article, to a page approval workflow, so once the page is approved, it will automatically post.

Just use the out-of-of box page approval workflow.   You’ll need to do the “Configure page approval flow” button in the screenshot above if you haven’t already.  Then, go to the Flow that it creates, called Submit SharePoint page for approval.

Go to the spot where it has a condition for what happens when the page is approved.  Add this same action there:

Voila!  Oh, and tell me if you get Rick Rolled while building your adaptive card.

This went live 4/15 on Power Hour:

 

 

References:

Adaptive cards for Microsoft Teams, now available

Drag and drop designer for adaptive cards

Microsoft Teams Developer reference for cards


Exit mobile version