How to Connect SharePoint News to Slack with Power Automate

Ashley Jolman, CSM

October 25, 2021

Get Slack channel notifications when SharePoint News is posted with Power Automate, and never miss another piece of company news!

Great Organizations Keep Employees Informed

Letting everyone know about news updates is important for keeping people engaged and feeling valued. SharePoint News Posts are a great way to communicate dynamic, easy-to-consume information. As a result, many organizations use SharePoint sites to store, organize, share, and access information, as well as for publishing newsworthy content. Just as important as creating the news is distributing it through the proper channels. Therefore, it’s imperative to alert employees when new articles are posted, ideally without the burden of yet another email that may end up buried. Microsoft Teams has a news connector that is easily set up to alert channels of new news posts. However, many organizations use Slack to stay connected, and a news post alert to Slack could be the best way to be sure your news post gets the maximum amount of exposure.

Connect SharePoint News to Slack

There isn’t an out-of-the-box connector for SharePoint News and Slack. The good news is, you can connect SharePoint News to Slack by creating a custom flow in Power Automate. While a lot of flow templates exist for common actions across Microsoft 365 and beyond, there isn’t one for connecting SharePoint News to Slack. This article will walk you through exactly how to set this up for your organization.

Setup in Power Automate

The first thing you’ll want to do, is open Power Automate and click `+ Create` on the main navigation to begin creating your new flow. You’re going to want to start from a blank, Automated cloud flow. Enter a name for your flow, and then select the SharePoint trigger `when a file is created or modified` (properties only). This triggers when an item is created or modified in a library.

Once you click `Create Flow`, you’ll be brought to the page to build your steps. The initial step is to identify the SharePoint page and Library you want this flow to be checking for the news articles. Simply copy and paste the URL of the SharePoint site you're looking for in this field. Since News articles are created as a site page, that will be the library we want this flow to check. For the `Library Name`, you’ll need to enter `Site Pages` as a custom value, and then leave the folder section blank. It will look something like this before you’re ready to go to the next step:

Setup Your Variable

From here, click `+ New Step`. For this new operation, you’ll need to select the operation: Initialize Variable – create string variable for `version` from the list of options. Here’s what you need to initialize your variable and complete the other boxes in this operation:

  • Name: Version
  • Type: String
  • Value: 1.0 (when the version type hits 1.0, the action should be triggered. SharePoint news articles change to 1.0 when first published)

The final result looks like this:

Next, hit `+ New Step` again to create the final operation. For this operation, you’ll want to select `Condition`. This is because we are going to want to set up a response for if the variable’s condition has been triggered or not. After selecting `Condition` as your operation, Power Automate will automatically provide boxes to complete for the condition itself, as well as actions for `if yes` and `if no`.  

Define The Condition

We’ll start with defining the condition. We need to set the condition to check if the article is published, and if it is a news page since we only want this alert to trigger if a news article specifically is posted (opposed to any other type of page). Power Automate will already have available dynamic content from the apps and connectors you have already used in this flow. For this one, mainly SharePoint dynamic content options. You will want to search the available content options for SharePoint `Version number`. If SharePoint dynamic content is not showing up for use, you’ll want to review the previous steps and be sure the flow has been configured correctly so far. To continue, set the following 2 conditions:

  • `Version number’ is equal to variable ‘version X` (the variable you created in the previous step which means the first time an article is published)

And

  • `Promoted state` is equal to `2` (just enter the number 2, no dynamic content necessary)

The outcome of this will look like this:

Next, we are going to set up the actions for `if yes` and `if no`. For the `if no` condition, simply leave blank, as no action is required if the condition has not been met. For the `if yes` condition, you’re going to want to set up the post to Slack.

Posting to Slack

The first step is to `add an action`, and search and select the Slack connector. The first time you do this there will be a couple of steps Power Automate will guide you through to set up the connection to your Slack environment.

At this point, you’ll be setting up the message that you want to be posted, as well as where exactly you want it posted. The first thing this action asks you to do is select which Slack Channel you want your message posted in. The channels are often pre-populated but there’s also an option to simply type in the name of your channel. In the Message Text box, you can type out what you want the message to be, but also be sure to utilize the SharePoint dynamic content to select certain aspects of the News post that you’d like included on the Slack post. For my example, I typed a title and then chose for the dynamic content to pull the Title, Author, quick Description, and a link to the article. Always be sure to include a link to the full article in your notification! Here’s how my `if yes` condition ended up:

Almost done! Now be sure to save the flow, and go test it out! You will need to create a test News article in SharePoint to fully test this flow. Here’s how the automated post looks in Slack, within the Channel I specified:

Conclusion

So, there you have it! If your team uses Slack, but you create news posts in SharePoint, this is a great way to ensure everyone stays informed and current on company news and updates.

No items found.
Thanks!
Was this helpful?