Forum Discussion
Jeff_Lacarte
Nov 05, 2021Brass Contributor
Approval Status Column Suddenly Numeric - Due to Column Formatting?
I'm working in my tenant and noticed an issue with all of my lists that have content approval turned on. The approval status column now lists a number instead of the words "Approved" | "Rejected" | "...
- Nov 16, 2021
Jeff_Lacarte nfsg20 DavidLang Amiryunus SteveB aricornish YeBuu mcancela Duncan2450 Gavin Tully TonieB
This is happening because of recent change in JSON schema to officially support Approval Status column in JSON formatting.
Due to this update, the @currentField and [$_ModerationStatus] will resolve to internal code (enum value) and @currentField.displayValue and [$_ModerationStatus.displayValue] will resolve to the localized string (I guess according to language).
The Microsoft official docs will be updated with more info in the coming weeks. You can check the details for now at: SharePoint Online Column Formatting for Approval Status: uses language specific text?
Related Read: How to find the Internal name of columns in SharePoint Online?
Please consider giving a Like if my post helped you in any way. For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs
Jeff_Lacarte
Nov 08, 2021Brass Contributor
Fixed it with a workaround, but it's still an issue. I can't be expected to use a workaround for every list that I need to apply conditional formatting to the approval status column.
By going into advanced mode to work with the formatting JSON directly I could see:
"txtContent": "[$_ModerationStatus]"
which is displays the value for a given item in a row of the column.
Through trial and error and referencing the syntax reference, I found that you can use '@currentField', which also displayed the numeric value of the approval status. However, once I added '.displayValue' the text value showed up again!
"txtContent": "@currentField.displayValue"
As for why this happened? I have no idea. This is a workaround for now.
- nfsg20Nov 15, 2021Copper ContributorHad the same issue at a customer. This is actually a good change because you don't have to check the approval status value for multiple languages anymore (if this is necessary for you). I hope it does not get reverted.
- Jeff_LacarteNov 15, 2021Brass ContributorGiving you access to the enumeration value is a good change sure, but changing the returned value of an existing variable is not. People have built custom views around this, and to change it is not ok.
- ganeshsanapNov 16, 2021MVP
Jeff_Lacarte nfsg20 DavidLang Amiryunus SteveB aricornish YeBuu mcancela Duncan2450 Gavin Tully TonieB
This is happening because of recent change in JSON schema to officially support Approval Status column in JSON formatting.
Due to this update, the @currentField and [$_ModerationStatus] will resolve to internal code (enum value) and @currentField.displayValue and [$_ModerationStatus.displayValue] will resolve to the localized string (I guess according to language).
The Microsoft official docs will be updated with more info in the coming weeks. You can check the details for now at: SharePoint Online Column Formatting for Approval Status: uses language specific text?
Related Read: How to find the Internal name of columns in SharePoint Online?
Please consider giving a Like if my post helped you in any way. For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs
- TonieBNov 09, 2021Copper Contributor
This problem suddenly started for me today on all libraries where there is formatting on the Approval Status column. The problem is not resolved by turning off the column formatting. When I turn off the column formatting, now instead of a number the Approval Status column is blank. I had to go then into the Advanced link and delete the json code, which should already disappear when I turned off the column formatting. I don't see any other info on this issue except for your post, but surely this must be occurring due to some Microsoft change. (My Approval Status columns have been formatted for over a year and I have made no recent changes to my site or libraries.) Jeff_Lacarte
- Jeff_LacarteNov 09, 2021Brass Contributor
TonieB Thank you for confirming that you have the same problem. I suspected it might have been a MS change behind the scenes.
I encourage others to try testing a new list with content approval turned on and try adding column formatting on the Approval Status column. I suspect you will have the same results as TonieB and I. It would be helpful too if others post their results here.
TonieB, if your JSON formatting isn't terribly complex, I would try copying it into an editor like VS Code and do a find and replace on: [$_ModerationStatus] to @currentField.displayValue. That should at least get you back up and running as a workaround for now.
- YeBuuNov 10, 2021Copper ContributorThe same issue identified!
Thanks Jeff_Lacarte for workaround!