How to create an RSS reader using SharePoint news
RSS feeds are a great way to keep updated with everything being posted in the sites you are following. SharePoint has a native integration for this feature but the layout is not that good, and it lacks the support for all the modern features the platform has been receiving.
In this article I’ll explain step by step how you can reuse the out of the box SharePoint news web part to create your own RSS reader web part.
This solution makes use of the SharePoint news web part, Power Automate and a SharePoint feature called News Link that allows you to publish external pages as SharePoint news.
To create your own RSS reader on SharePoint start by doing the following:
- Open Power Automate and sign in with your account
- On the vertical menu click on Create and then on Automated flow
- Provide a name to the flow g. SharePoint News
- Select the trigger When a feed item is published
- Click on Create
- Paste the link to the RSS feed
- Click on + New step
- Search for HTML to text, this removes any html tags from the text
- Click in the content text box and select Feed Summary
- Click on + New step
- Search for Send an HTTP request to SharePoint
- Fill the form with the following details:
- Site address – The site collection where you want to post the news
- Method – POST
- Uri – /_api/sitepages/pages/reposts
- Headers
content-type: application/json; odata=verbose; charset=utf-8
accept: application/json - Body
{"BannerImageUrl":"Your Image Banner URL","Description":"@{body('Html_to_text')}","IsBannerImageUrlExternal":true,"OriginalSourceUrl":"@{triggerOutputs()?['body/primaryLink']}","ShouldSaveAsDraft":false,"Title":"@{triggerOutputs()?['body/title']}","__metadata":{"type":"SP.Publishing.RepostPage"}}
In the body replace the Banner Image Url by the link to your own image, this must be done since the RSS feed connector does not bring the image from the feed
- Click on Save
The flow is now running and every time something new is published a news link will be created on your SharePoint site. To see the new post on SharePoint making use of the news web part do the following:
- Open the SharePoint site where you want to display the RSS reader
- Edit the page and click on the + icon to add a new web part
- Search for News and add it
- Open the settings and Select the site where the feed is being published
- Adjust the web part settings to your needs and Republish the page
It might take a few days to see anything on the page, but you will end up with a good-looking RSS reader web part that integrates with the SharePoint Home site and the SharePoint mobile App.
If you want to see this in action have a look to the solution, I’ve implemented using this method demoed in the video below.
November 1, 2020
Thanks for publishing could you clarify from where does the Body keyword come from, it would be great if you would have shown how you filled the body content in the Step of Send an Http request to Sharepoint
November 1, 2020
Hi,
I’ve covered it in another article, you can find it here https://sharepoint.handsontek.net/2020/11/01/post-sharepoint-news-link-programmatically/
Let me know if you need any further clarification, have a nice day
November 11, 2020
Love this as a solution João!
But my Flow failed in the “Send HTTP request….” step.
{“BannerImageUrl”:”https://**************************.com/sites/TeamsTraining/SiteAssets/Microsoft_Teams-Logo.png”,”Description”:”@{triggerOutputs()?[‘body’]}”,”IsBannerImageUrlExternal”:true,”OriginalSourceUrl”:”@{triggerOutputs()?[‘body/primaryLink’]}”,”ShouldSaveAsDraft”:false,”Title”:”@{triggerOutputs()?[‘body/title’]}”,”__metadata”:{“type”:”SP.Publishing.RepostPage”}}
Error:
{“odata.error”:{“code”:”-1, Microsoft.SharePoint.Client.InvalidClientQueryException”,”message”:{“lang”:”en-US”,”value”:”Invalid JSON. The property name ” is not valid. The name of a property cannot be empty.”}}}
clientRequestId: f8009217-fd5f-448a-ab5c-b165a06f1ecf
serviceRequestId: 8a518c9f-40d0-a000-d046-48848b9e0807
Please help.
November 16, 2020
Hi Paul,
Can you please let me know what is the RSS url you are using so I can try to reproduce the issue locally?
My best,
João Ferreira
November 11, 2020
Really creative use of out of the box components. Well done!
November 12, 2020
I set this up but I’m getting a 400 status error:
“Invalid JSON. A token was not recognized in the JSON content”
For this test I’m using the world news feed from CNN – http://rss.cnn.com/rss/edition.rss and posting to a test SP site.
November 13, 2020
Fixed a few syntax errors, including removing the “IsBannerImageUrlExternal” property (because of an error that says it doesn’t exist in the repost page type), and now the flow succeeds and creates a url in the SP site that links to the external post BUT- IT DOESN’T CREATE A NEWS LINK.
November 16, 2020
Hi Matthew,
Can you please share with me a screenshot of the flow and another one from the error?
I’ve replicated your scenario on my end and I’m waiting for a new rss post to see what happens.
Have a nice day 🙂
November 16, 2020
Joao – I didn’t look at this over the weekend but this morning I see one article WAS published as a news link last Friday, and then several over the weekend. I noticed though there were several duplicates of the same article (see screenshot below).
Here’s the flow screenshot:
https://powerusers.microsoft.com/t5/image/serverpage/image-id/196835iAA4C6C5C7801FB05/image-size/large?v=1.0&px=999
Duplicate articles:
https://powerusers.microsoft.com/t5/image/serverpage/image-id/197424iDCE074C2F5B0310E/image-size/large?v=1.0&px=999
November 17, 2020
Hi Matthew,
I’ve reproduced your scenario yesterday and I got a few news published already without having duplicates.
I’ve noticed that the RSS connector has changed since I did the article and now has a new property to determine when a new item is new, I’m assuming that if it’s not defined the flow will be executed every-time an update is made to the article, more info about the connector can be found here.
This is how my configuration looks like, let me know if it solved the issue.
Have a nice day 🙂
January 8, 2021
Thank you very much for this tutorial and these very clear explanations. I finally managed to get this rendering !!
Do you know if it is possible to enable likes and comments on these articles?
February 2, 2021
Hi Joao,
I am getting the error below. Can you assist me with fixing this? The feed I’m connecting to is https://techcommunity.microsoft.com/plugins/custom/microsoft/o365/custom-blog-rss?tid=-2538899071346541984&board=MicrosoftTeamsBlog&label=&messages=&size=10
{“odata.error”:{“code”:”-1, Microsoft.SharePoint.Client.InvalidClientQueryException”,”message”:{“lang”:”en-US”,”value”:”An entry without a type name was found, but no expected type was specified. To allow entries without type information, the expected type must also be specified when the model is specified.”}}}
Thank You,
Damon
February 2, 2021
I was able to fix this by adding a double underscore for “__metadata” and it fixed the issue.
February 3, 2021
Hi Damon,
Thanks for letting me know about the fix.
Have a nice day 🙂
February 5, 2021
Hello, my first comment is awaiting moderation, so I post a second time.
Thank you very much for this tutorial and these very clear explanations. I finally managed to get this rendering !!
Do you know if it is possible to enable likes and comments on these articles?
February 5, 2021
Hi Myriam,
My apologies for taking so long to check your comments, I’m trying to keep up with them but its not been easy.
About your question, it is not possible to get likes and comments in News Links.
Have a nice day 🙂
February 8, 2021
Thanks for your answer !
April 11, 2022
Thank you so much for putting up this beautiful post and solution.
However, on my test page, the news comes out as duplicate. How can I fix it.
Thank you.
April 27, 2022
Hello,
Can you please check if the flow is running twice for the duplicated news?
Have a nice day 🙂