Forum Discussion
JSON format broken?
- Nov 16, 2021
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?
Similar thread: Approval Status Column Suddenly Numeric - Due to Column Formatting?
Related Read: How to find the Internal name of columns in SharePoint Online?
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs
WorkflowIQ Try using:
"visibility": "=if([$_ModerationStatus.displayValue] == 'Pending', 'visible', 'hidden')"
OR instead of "visibility", use this:
"display": "=if([$_ModerationStatus.displayValue] == 'Pending', 'block', 'none')"
Use [$_ModerationStatus.displayValue] with capital M.
Also, are you using SharePoint online or SharePoint 2019?
Please consider giving a Like if my post helped you in any way.
ganeshsanap Thanks, that worked! I used "visibility" but Display seemed to work also. I am very grateful for your help. This has taken so much of my time trying to work out.
- ganeshsanapNov 16, 2021MVP
WorkflowIQ Great, glad it worked you!
you can use either one to show/hide the element. But, I prefer "display: none" property as it completely removes the element from DOM. Check this for more information: What is the difference between visibility:hidden and display:none?
Please consider giving a Like if my post helped you in any way.
- WorkflowIQNov 16, 2021Copper ContributorI was on SP online by the way