Nov 10 2021 05:46 PM - edited Nov 15 2021 04:25 PM
Hi all,
I have just noticed today that a formatted column button I use in SharePoint libraries for many different customers no longer shows. I have checked multiple tenants where the JSON for the button has not changed for a long time, suddenly no longer displays. It was displaying correctly the last time i checked a few days ago. Can someone else please check? It may be system wide and affect a lot of people.
Sample JSON below
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "button",
"txtContent": "=if([$ReviewStatus]=='Approval','Sent for Approval',if([$ReviewStatus]=='Review','Review in progress','Send for Approval'))",
"customRowAction": {
"action": "executeFlow",
"actionParams": "='{\"id\": \"' + if([$ReviewStatus]=='','Flowidhere',if([$ReviewStatus]=='No','Flowidhere',' ')) + '\"}'"
},
"style": {
"background-color": "=if([$ReviewStatus]=='Approval','Orange',if([$ReviewStatus]=='Review','Red','Green'))",
"color": "white",
"border-radius": "20px",
"border-style": "solid",
"border-color": "white",
"border-width": "4px",
"visibility": {
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
"[$_ModerationStatus]",
"Pending"
]
},
"visible",
"hidden"
]
}
}
}
Nov 10 2021 06:33 PM
Nov 16 2021 02:33 AM
Nov 16 2021 02:20 PM - edited Nov 16 2021 02:21 PM
@Danie365 There is another post where someone has given an answer saying there was a change to how JSON handles the Approval Status column. I am not super skilled in JSON so I am trying to work out myself, and ask a few others what the replacement code would be. I will post here if I work it out or someone helps us out with this one.
Post:
Nov 16 2021 09:43 PM
SolutionThanks to @ganeshsanap and @Danie365 for the help with the below. I have tested and it works for me.
"visibility": "=if([$_ModerationStatus.displayValue] == 'Pending', 'visible', 'hidden')"
Nov 16 2021 09:43 PM
SolutionThanks to @ganeshsanap and @Danie365 for the help with the below. I have tested and it works for me.
"visibility": "=if([$_ModerationStatus.displayValue] == 'Pending', 'visible', 'hidden')"