Forum Discussion
WorkflowIQ
Nov 11, 2021Copper Contributor
JSON column formatting on Approval status broken?
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...
- Nov 17, 2021
Thanks 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')"
WorkflowIQ
Nov 11, 2021Copper Contributor
I have performed some testing (by elimination) and the issue seems to be with the if statement looking at the status of the approval. If I change:
""visibility": {
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
"[$_ModerationStatus]",
"Pending"
]
},
"visible",
"hidden"
]
}"
to
"visibility": "visible"
The buttons show and work correctly except they always show. I need them to only show when the status of the document is "Pending" as the button launches a document approval flow.
Does anyone know if there were any changes to the way the approval Status is handled in SP JSON?
""visibility": {
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
"[$_ModerationStatus]",
"Pending"
]
},
"visible",
"hidden"
]
}"
to
"visibility": "visible"
The buttons show and work correctly except they always show. I need them to only show when the status of the document is "Pending" as the button launches a document approval flow.
Does anyone know if there were any changes to the way the approval Status is handled in SP JSON?
- Danie365Nov 16, 2021Brass ContributorAlso seeing this issue under the exact same circumstances (you are not alone!)
Unfortunately I have not found a fix for this myself. Hopefully someone else can shed some light on this- WorkflowIQNov 16, 2021Copper Contributor
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: