CHUVASH.eu

CHunky Universe of Vigourous Astonishing SHarepoint :)

Tag Archives: news

Demote News in SharePoint Online

In case you published a news in SharePoint Online and you now want to “downgrade” it to a regular page, I have a solution for you.

The reasons why you would like to demote a News might vary:

  • You publish an important message, perhaps a note about an operational disturbance. It might not relevant anymore, but you still want to keep the page in case someone wants to access the information.
  • You accidentally create a page as a news.
An example of a news of a temporary character

The News “Promotion” is controlled through the field called “Promoted State”. You cannot edit, but you can include it in a view to check the current state of it.

  • “0” means a regular site page
  • “2” means News
Show the “Promoted State” and ID to check the current status and identify pages and news

So in order to convert a news to a regular page, you need to update the list item’s field “Promoted State” from 2 to 0.

Unfortunately, the Promoted State field is read only. Hence we need to make it editable first, edit it, and in the end, reset the field.

Lucky us, that is easily done with PnP 🙏🙏🙏🙏🙏

$site = "https://{tenant}.sharepoint.com/sites/{site}"
Connect-PnPOnline Url $site SPOManagementShell ClearTokenCache
$field = "Promoted State"
$list = "Site Pages"
$id = 85 #the item id of the news
Set-PnPField Identity $field List $list Values @{ReadOnlyField=$false}
#make sure to enclose the number into quotation marks
Set-PnPListItem List $list Identity $id Values {"Promoted State"="0"}
#reset the field
Set-PnPField Identity $field List $list Values @{ReadOnlyField=$true}
view raw demote-news.ps1 hosted with ❤ by GitHub

That’s it. Easy, isn’t it?. I wonder why the field is readonly, though. What downsides might this procedure have? What do you think?

Daniel Chronlund Cloud Tech Blog

News, tips and thoughts for Microsoft cloud fans

Вула Чăвашла

VulaCV - Чăвашла вулаттаракан сайт

Discovering SharePoint

And going crazy doing it

Bram de Jager - Architect, Speaker, Author

Microsoft 365, SharePoint and Azure

SharePoint Dragons

Nikander & Margriet on SharePoint

Mai Omar Desouki

PFE @ Microsoft

Cameron Dwyer

Office 365, SharePoint, Azure, OnePlace Solutions & Life's Other Little Wonders

paul.tavares

Me and My doings!

Share SharePoint Points !

By Mohit Vashishtha

Jimmy Janlén "Den Scrummande Konsulten"

Erfarenheter, synpunkter och raljerande om Scrum från Jimmy Janlén

Aryan Nava

DevOps, Cloud and Blockchain Consultant

SPJoel

SharePoint for everyone

SharePointRyan

Ryan Dennis is a SharePoint Solution Architect with a passion for SharePoint and PowerShell

SharePoint 2020

The Vision for a Future of Clarity

Aharoni in Unicode

Treacle tarts for great justice

... And All That JS

JavaScript, Web Apps and SharePoint

blksthl

Mostly what I know and share about...