0

UPDATE:::

Sorry everyone I have been clearer. This is supposed to be for the "format my view" feature in the Sharepoint Online custom list. I'm trying to make the entire row change color based on the "assigned?" column. I know i can do it for the column only but I want the whole row to highlight. When I try several guides, nothing happens.

This is one of the guides that I used but it didn't change the view. https://support.office.com/en-us/article/formatting-list-views-f737fb8b-afb7-45b9-b9b5-4505d4427dd1

enter image description here

I'm sure that this code is written correctly but it's not doing anything. A coworker of mine is helping me with the JSON but neither of us can figure out why it isn't working on Sharepoint Online.

enter image description here

Here is the code.

{
    "$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
    "elmType": "div",
    "txtContent": "@Assigned?",
    "style":
    {
        "color": "#fff",
        "padding-left": "14px",
        "background-color":
        {
            "operator": "?",
            "operands": [
            {
                "operator": "==",
                "operands": ["@Assigned?", "Not Released Yet"]
            }, "#2ECC71",
            {
                "operator": "?",
                "operands": [
                {
                    "operator": "==",
                    "operands": ["@Assigned?", "Needs Reassignment"]
                }, "#E74C3C",
                {
                    "operator": "?",
                    "operands": [
                    {
                        "operator": "==",
                        "operands": ["@Assigned?", "Needs Assignment"]
                    }, "#F1C40F",
                    {
                        "operator": "?",
                        "operands": [
                        {
                            "operator": "==",
                            "operands": ["@Assigned?", "Assigned"]
                        }, "#FFFFF", ""]
                    }]
                }]
            }]
        }
    }
}
3

2 Answers 2

1

What does "@Assigned?" represent in your code? Is it the name of current column? If so, pleace use "@currentField" instead of "@Assigned?".

{
    "$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
    "elmType": "div",
    "txtContent": "@currentField",
    "style":
    {
        "color": "#fff",
        "padding-left": "14px",
        "background-color":
        {
            "operator": "?",
            "operands": [
            {
                "operator": "==",
                "operands": ["@currentField", "Not Released Yet"]
            }, "#2ECC71",
            {
                "operator": "?",
                "operands": [
                {
                    "operator": "==",
                    "operands": ["@currentField", "Needs Reassignment"]
                }, "#E74C3C",
                {
                    "operator": "?",
                    "operands": [
                    {
                        "operator": "==",
                        "operands": ["@currentField", "Needs Assignment"]
                    }, "#F1C40F",
                    {
                        "operator": "?",
                        "operands": [
                        {
                            "operator": "==",
                            "operands": ["@currentField", "Assigned"]
                        }, "#FFFFF", ""]
                    }]
                }]
            }]
        }
    }
}

Test result: enter image description here

0

I have the impression that you have misled, there is two errors appearing here:

The first is "txtContent": "@Assigned?" should be "txtContent": "@currentField"

The second you are trying to format a row in a column formatting section ? even if you correct the first error it will format only the column you are working on, but for the whole row please check this article: https://aslamsumayya.wordpress.com/2015/04/10/changing-colors-in-sharepoint-list-rows-conditional-formatting-in-sharepoint-2013online/

I hope this will enlighten you something, Best wishes for you.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.