SharePoint list conditional formatting stopped working

Deividas Belovas 21 Reputation points
2021-11-16T13:39:08.403+00:00

Hello,

I have simple list where row color depends on approval status. It was working like a charm and stopped for some reason and i can't find out why. I have tried to recreate it

149853-image.png

149828-image.png

149813-image.png

{

"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",

"additionalRowClass": {

"operator": ":",

"operands": [

{

"operator": "==",

"operands": [

"[$_ModerationStatus]",

"Approved"

]

},

"sp-css-backgroundColor-BgMintGreen sp-css-color-MintGreenFont",

{

"operator": ":",

"operands": [

{

"operator": "==",

"operands": [

"[$_ModerationStatus]",

"Rejected"

]

},

"sp-css-backgroundColor-BgCoral sp-field-fontSizeSmall sp-css-color-CoralFont",

{

"operator": ":",

"operands": [

{

"operator": "==",

"operands": [

"[$_ModerationStatus]",

"Pending"

]

},

"sp-css-backgroundColor-BgGold sp-field-fontSizeSmall sp-css-color-GoldFont",

""

]

}

]

}

]

}

}

If i add another rule in the same place like this it works. It looks like the problem is with "Approval Status" column.

149804-image.png

149852-image.png

Thank you for your time!

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,205 questions
{count} votes

Accepted answer
  1. Emily Du-MSFT 50,021 Reputation points Microsoft Vendor
    2021-11-17T02:41:08.417+00:00

    @Deividas Belovas

    There are some updates in the JSON formatting.

    Please use following codes in the advanced mode of view JSON formatting.

    {
    "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
    "additionalRowClass": {
    "operator": ":",
    "operands": [
    {
    "operator": "==",
    "operands": [
    "[$_ModerationStatus.displayValue]",
    "Approved"
    ]
    },
    "sp-css-backgroundColor-BgMintGreen sp-field-fontSizeSmall sp-css-color-MintGreenFont",
    {
    "operator": ":",
    "operands": [
    {
    "operator": "==",
    "operands": [
    "[$_ModerationStatus.displayValue]",
    "Rejected"
    ]
    },
    "sp-css-backgroundColor-BgCoral sp-field-fontSizeSmall sp-css-color-CoralFont",
    {
    "operator": ":",
    "operands": [
    {
    "operator": "==",
    "operands": [
    "[$_ModerationStatus.displayValue]",
    "Pending"
    ]
    },
    "sp-css-backgroundColor-BgGold sp-field-fontSizeSmall sp-css-color-GoldFont",
    ""
    ]
    }
    ]
    }
    ]
    }
    }

    Result:
    150033-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.