New Connector web part in modern sites

A few hours ago Jeff Teper announced a blog post by Mark Kashman titled “Use SharePoint web parts to showcase data from inside and outside Office 365”.

Exciting new webparts for the modern #SharePoint experience https://t.co/T5dSWhHDc1

— Jeff Teper (@jeffteper) February 20, 2018

This post [Link] contains a list of new SharePoint framework web parts that started to roll out to Targeted Release tenants today. I got lucky, my tenant already has some of the new web parts. The new ones are:

  • Planner– display tasks and progress from your team plans
  • Twitter– highlight individual tweets and full feeds
  • Office 365 Connectors– embed information from 3rd party services like Bitbucket, JIRA, and RSS
  • Kindle Instant Preview – reference an important Kindle book with one-click to preview or buy

As I did some work last year on Connectors in Teams already let’s have a look what this web part can do in a modern SharePoint team site. Heads-up Connectors are only working in group-connected SharePoint teams sites, means no communication sites as for today. When you edit your modern team site and click on add web part you should see something like this:   In this screen, I already narrowed the web part category down to Connectors to see all the possible ones. After clicking on Incoming Webhook you should be able to configure your new Connector right in the web part settings. I don’t know if it’s expected this way, but after clicking on create the form closes and you are back on the page. As we need the URL from the webhook in the next step you need to click on edit web part again and should now see the created URL at the bottom of the dialogue. My guess, this will maybe change in the future or the rollout isn’t totally done yet even if the rest is working fine. Now that we have our webhook up and running it’s time to invoke it with some O365 Connector cards. For me, the easiest way to do this is to open up PowerShell ISE and run some already prepared testing scripts that I used in demos for the last months. Combining two of them and triggering them got me this screen: Here you see two cards from the new Connector displayed in my modern team site. For demo purpose, I deleted all the default web parts so we can focus on the cards. Both of them are very simple cards but you can get more complex examples here: https://docs.microsoft.com/en-us/outlook/actionable-messages/card-reference As Connectors use webhooks to create Connector Card messages within an Office 365 group you can use the same cards also in Microsoft Teams. In my example above I used to call them in PowerShell with the following script``` $uri ='%YOUR_CONNECTOR_URL_FROM_THE_WEB_PART_SETTINGS_PANE%'

$status = ‘success’ $fact1 = ‘[Register](https://events.collab365.community/?utm_source=About&utm_medium=Site&utm_campaign=Network)’ $fact2 = ‘[Buy Swag here](https://store.collab365.community/?utm_source=TopBanner&utm_medium=Site&utm_campaign=Network)’

$body = ConvertTo-Json -Depth 4 @{ title = ‘HELLO COLLAB365’ text = “This demo is a $status” sections = @( @{ activityTitle = ‘Infos’ activitySubtitle = ‘Want to know more?’ activityText = ‘Collab365 is a network of online sites (managed by Collaboris) that are designed to serve the Office 365 community. Check out our network by reading further below…’ activityImage = ‘https://today.collab365.community/wp-content/uploads/sites/3/2017/07/collab365-small.png' # this value would be a path to a nice image you would like to display in notifications }, @{ title = ‘Details’ facts = @( @{ name = ‘Next Events’ value = $fact1 }, @{ name = ‘Store’ value = $fact2 } ) } ) potentialAction = @(@{ ‘@context’ = ‘http://schema.org’ ‘@type’ = ‘ViewAction’ name = ‘Click here to visit COLLAB365’ target = @(‘https://collab365.community’) }) }

Invoke-RestMethod -uri $uri -Method Post -body $body -ContentType ‘application/json’