Forum Discussion
Tanya Denton
Mar 27, 2019Steel Contributor
Approval Status Column Formatting - gone!
I may be having a senior moment, but the column formatting on a document library with Approval Status switched on has disappeared. It was there the other day but looking at it now it looks like this
I presume I used the view format, as when I tried to reapply the format using column format the option is not there on this column (it is on all the other columns in the library). The view format is now empty - really confused - anyone out there experiencing the same problem or can point me in the right direction pretty please?
Tanya Denton . We faced the same issue the same day, it seems that Microsoft have removed that option. I managed to remove JSON format by going to hidden field in this way: https://yoursite/_layouts/15/FldEdit.aspx?List=ListID&Field=_ModerationStatus.
You can go to another field's settings of the same list and replace that field name for "_ModerationStatus" in the url.
42 Replies
Sort By
- salvatore carluccioCopper Contributor
I have fixed the issue by using this JSON:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"attributes": {
"class": "=if([$_ModerationStatus] == 0, 'sp-field-severity--good', if([$_ModerationStatus] == 2, 'sp-field-severity--warning', if([$_ModerationStatus] == 1, 'sp-field-severity--severeWarning', 'sp-field-severity--blocked'))) + ' ms-fontColor-neutralSecondary'"
},
"children": [
{
"elmType": "span",
"style": {
"display": "inline-block",
"padding": "0 4px"
},
"attributes": {
"iconName": "=if([$_ModerationStatus] == 0, 'CheckMark', if([$_ModerationStatus] == 2, 'Error', if([$_ModerationStatus] == 1, 'Warning', 'ErrorBadge')))"
}
},
{
"elmType": "span",
"txtContent": "=if([$_ModerationStatus] == 0, 'Approved', if([$_ModerationStatus] == 2, 'Pending', if([$_ModerationStatus] == 1, 'Warning', 'Rejected')))"
}
]
}- Thyran_WrightCopper Contributor
salvatore carluccio thank you we had the same issue today pop up for some reason and I fixed it with your JSON code.
Much appreciated
- Tanya DentonSteel ContributorThanks, but the post is 2 years old and all is working fine.
- kshaunakCopper Contributor
Tanya Denton Today I faced the same issue, resolved with JSON. Thanks
- ikoalosaurusCopper Contributor
Hello Tanya,
could you please share the code needed to have the column approval status display different colors for different values (it's an automatic column created in the library which i use for approval workflow) ?
Thank you : )
- Tanya DentonSteel Contributor
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"attributes": {
"class": "=if(@currentField == 'Approved', 'sp-field-severity--good', if(@currentField == 'Pending', 'sp-field-severity--low', if(@currentField == 'Draft', 'sp-field-severity--warning', if(@currentField == 'Rejected', 'sp-field-severity--severeWarning', 'sp-field-severity--blocked')))) + ' ms-fontColor-neutralSecondary'"
},
"children": [
{
"elmType": "span",
"style": {
"display": "inline-block",
"padding": "0 4px"
},
"attributes": {
"iconName": "=if(@currentField == 'Approved', 'CheckMark', if(@currentField == 'Pending', 'Forward', if(@currentField == 'Draft', 'Error', if(@currentField == 'Rejected', 'Warning', 'ErrorBadge'))))"
}
},
{
"elmType": "span",
"txtContent": "@currentField"
}
]
}
- nz_archerCopper Contributor
Hi Tanya Denton
I am having the exact same issue.
This was how my Approval Status column was before:
And this is how it is now:
This is very frustrating I hope it gets fixed soon
- Tanya DentonSteel Contributor
nz_archer - exactly the same for me
- escipionCopper Contributor
Tanya Denton . We faced the same issue the same day, it seems that Microsoft have removed that option. I managed to remove JSON format by going to hidden field in this way: https://yoursite/_layouts/15/FldEdit.aspx?List=ListID&Field=_ModerationStatus.
You can go to another field's settings of the same list and replace that field name for "_ModerationStatus" in the url.
Hi Tanya Denton,
If you share the JSON I am happy to test for you. I have a number of lists with custom formatting and they are all behaving as expected.
Norm
- Tanya DentonSteel Contributor@Norman thanks for such a quick reply. My problem is the JSON has gone (if it was there in the first place) in the Format VIEW, and there is no option on the Approval Status column to add a column format. This is why i am confused!
My custom JSON is working and so are my "Format Status column" settings.
Did the choice values happen to change?
Is there any JSON code listed in the list settings > edit column?