Forum Discussion
PromotedState does not update anymore
I wish to update the promoted status to 0 (page), 1 (unpublished news) or 3 (published news).
I was always doing this via SharePoints column formatting. See .json column formatting below. This worked perfectly fine until about this week. Now it doesn't seem to work anymore.
Now I tried updating the PromotedState also via PowerAutomate. This also doesn't seem to work... How should I now change the PromotedState.
Does someone have any clue how I can update the PromotedState or why the column formatting way of wokring, suddently doesn't work anymore?
The json code for column formatting.
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"style": {
"flex-wrap": "nowrap",
"display": "flex",
"flex-direction": "row"
},
"children": [
{
"elmType": "div",
"txtContent": "=if(@currentField == 0 ,'0 : Page' , if(@currentField == 1, '1 : News (Unpublished)' , if(@currentField == 2 , '2 : News','') ) )",
"style": {
"box-sizing": "border-box",
"padding": "4px 8px 5px 8px",
"display": "flex",
"border-radius": "16px",
"align-items": "center",
"overflow": "hidden",
"margin": "4px 4px 4px 4px",
"border": "1px solid"
},
"attributes": {
"class": "=if(@currentField == 0 ,'ms-fontColor-themePrimary ms-borderColor-themePrimary ms-bgColor-white' , if(@currentField == 1, 'ms-fontColor-themePrimary ms-borderColor-themePrimary ms-bgColor-themeLighter' , if(@currentField == 2 , 'ms-fontColor-white ms-borderColor-themePrimary ms-bgColor-themePrimary','') ) )"
}
},
{
"elmType": "div",
"style": {
"font-size": "18px",
"cursor": "pointer",
"padding": "10px",
"border-radius": "50%"
},
"attributes": {
"iconName": "MoreVertical",
"class": "ms-fontColor-themePrimary ms-bgColor-themeLighter--hover"
},
"customCardProps": {
"openOnEvent": "click",
"directionalHint": "rightCenter",
"isBeakVisible": true,
"formatter": {
"elmType": "div",
"style": {
"display": "flex",
"flex-direction": "column",
"align-items": "flex-start"
},
"children": [
{
"elmType": "div",
"txtContent": "Change to Page (0)",
"style": {
"padding": "10px 20px 10px 20px",
"cursor": "pointer",
"width": "200px"
},
"attributes": {
"class": "ms-bgColor-themeLighter--hover"
},
"customRowAction": {
"action": "setValue",
"actionInput": {
"PromotedState": "0"
}
}
},
{
"elmType": "div",
"txtContent": "Change to unpublished news (1)",
"style": {
"padding": "10px 20px 10px 20px",
"cursor": "pointer",
"width": "200px"
},
"attributes": {
"class": "ms-bgColor-themeLighter--hover"
},
"customRowAction": {
"action": "setValue",
"actionInput": {
"PromotedState": "1"
}
}
},
{
"elmType": "div",
"txtContent": "Change to published news (2)",
"style": {
"padding": "10px 20px 10px 20px",
"cursor": "pointer",
"width": "200px"
},
"attributes": {
"class": "ms-bgColor-themeLighter--hover"
},
"customRowAction": {
"action": "setValue",
"actionInput": {
"PromotedState": "2"
}
}
}
]
}
}
}
]
}
The HTTP SharePoint call to update the PromotedStatus.
6 Replies
- DBMandrakeCopper Contributor
On our site, Promoted State is a read only field. You can see this if you check the schema for the field in Site Pages using PnP-PowerShell. However I was able to change it to read/write using a PnP-Powershell session.
I don't remember exactly when I did this - probably 2-3 weeks ago, and it is still read/write and I am able to update promoted state using a json formatter. (I added it mainly so I can manually downgrade a page promoted to a news article back to a normal page)
By the way are you sure 3 is correct ? On our site 0 = Page, 1 = Unpublished News Page Draft, 2 = Published News page, none of them are 3.
- WYellowBrass Contributor
The 3 was a typo in my original post. But here it ain't working (still)You are able to change it using the json?
- WYellowBrass Contributor
The 3 was a typo in my original post. But here it ain't working (still). You are able to change it using the json?
- DBMandrakeCopper Contributor
Yes, I can change the status with json - but I had to change the field from Read Only to Read / Write using PNP-Powershell first. If you want more info I can try to figure out exactly how I did this as I didn't keep a copy of the script I used.
- Rob_ElliottSilver Contributor
After seeing your post I checked my JSON column formatting on Site Pages and had the same issue, so it looks as though Microsoft have made some changes somewhere to block this from being possible.
Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, Power Platform, WSP Global (and classic 1967 Morris Traveller driver)- WYellowBrass Contributor
Ugh, that sucks.
Can someone from Microsoft please confirm? And preferably also undo this? Such a functionality is really needed...