Rajesh
Rajesh 👨🏻‍💻developer, architect, consultant focussed on modernization, cognitive services, and conversational ai.

Post SharePoint updates to Microsoft Teams using Flow

Post SharePoint updates to Microsoft Teams using Flow

In this post, we will look into how to post the SharePoint updates to Microsoft Teams using Flow. Currently, Flow works only on the Office 365 platform. For the SharePoint on-premises, we need to use the alternate like SharePoint designer workflow, that’s another topic for another day.

For this post we will post the custom list updates to the teams channel, that is whenever a new item is added we will post an update that the new item is added along with its title. Let’s get started with the Microsoft Teams,

Create Connector

As a first step, we need to create a connector for the teams channel. Go to your favorite channel in teams where you want to post the SharePoint updates
Click on the ellipsis (…) and then select connectors.

enter image description here

Add an incoming WebHook connector, and provide the title for your connector. If you have an image which you prefer to show in teams whenever a message is posted then upload that image here. I prefer to use the default image for this exercise.

enter image description here

Once you hit save, copy the URL of the WebHook which we will use in our Flow to post the message.

Microsoft Flow

Let’s get into creating the flow, go to https://flow.microsoft.com/ and click on My Flows. Let’s choose to create from blank. Give a desired title for the flow, I’m giving it “SharePoint to Microsoft Teams”.

Next, go ahead and search for triggers. In this case search for SharePoint and select “SharePoint — when item is added”. You need to provide the SharePoint site URL and then select the list from the drop-down for which we will be posting the messages.

Click on the next step and select add an action, in this step we will be using “HTTP” action, search for HTTP and select the action. You need to select Post as a method, and in the Uri, field put the URL we copied from incoming Web-Hook connector. In the headers, set the content type as

1
{ Content-Type: application/json }

In the body of the request, { “title”, “New item added in SharePoint list”, “text”, “«List item title»”} in the text field I have used the dynamic content from the list. You can change the body as desired.

enter image description here

Click on create and then done.

Create an Item in a SharePoint list

Let’s go ahead and test our flow, go the SharePoint list which selected in the flow creation process and creates an item. Give a minute and check the flow you should be able to see the action successfully executed.

enter image description here

Microsoft Teams Channel

If everything goes well, we should be able to see the post on the Microsoft team’s channel where we configured the Web-Hook connector.

enter image description here

That’s it we have created a flow that posts updates to the channel whenever an item is created in SharePoint, we can change the action as desired for document add, update and other actions of SharePoint as well.

comments powered by Disqus