1

I am trying to have a footer with a border (with color changing based on a value), and then add links after that (no background).

I was able to do them separately, but I cannot combine them successfully:

For the border:

{
    "elmType": "div",
    "style": {
        "font-size": "10px",
        "border-top-width": "5px",
        "padding-top": "8px",
        "display": "flex",
        "justify-content": "center"
    },
    "attributes": {
        "class": "=if([$Result] == 'Successfully Done', 'sp-css-backgroundColor-BgMintGreen', if([$Result] == 'In Progress', 'sp-css-backgroundColor-BgSage', if([$Result] == 'Thinking about it', 'ms-bgColor-neutralLight', if([$Result] == 'Rejected', 'ms-bgColor-yellow', 'ms-bgColor-yellow')))) + ' ms-fontColor-neutralPrimary'"
    }
}

For the links:

{
    "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
    "elmType": "div",
    "style": {
        "display": "flex",
        "flex-direction": "column",
        "justify-content": "flex-start",
        "align-items": "flex-start"
    },
    "children": [
        {
            "elmType": "div",
            "txtContent": "References:",
            "style": {
                "font-weight": "bold"
            }
        },
        {
            "elmType": "a",
            "txtContent": "TestName1",
            "attributes": {
                "target": "_blank",
                "href": "TestLink1"
            }
        },
        {
            "elmType": "a",
            "txtContent": "TestName2",
            "attributes": {
                "target": "_blank",
                "href": "TestLink2"
            }
        },
        {
            "elmType": "a",
            "txtContent": "TestName3",
            "attributes": {
                "target": "_blank",
                "href": "TestLink3"
            }
        }
    ]
}
1
  • Can you add any mock image how you want to show the colored footer and links? Commented May 20, 2023 at 7:20

1 Answer 1

0

Use JSON like below for SharePoint list form configure layout > footer settings:

{
    "elmType": "div",
    "style": {
        "display": "block",
        "width": "100%"
    },
    "children": [
        {
            "elmType": "div",
            "style": {
                "font-size": "10px",
                "border-top-width": "5px",
                "padding-top": "8px",
                "display": "flex",
                "justify-content": "center"
            },
            "attributes": {
                "class": "=if([$Result] == 'Successfully Done', 'sp-css-backgroundColor-BgMintGreen', if([$Result] == 'In Progress', 'sp-css-backgroundColor-BgSage', if([$Result] == 'Thinking about it', 'ms-bgColor-neutralLight', if([$Result] == 'Rejected', 'ms-bgColor-yellow', 'ms-bgColor-yellow')))) + ' ms-fontColor-neutralPrimary'"
            }
        },
        {
            "elmType": "div",
            "style": {
                "display": "flex",
                "flex-direction": "column",
                "justify-content": "flex-start",
                "align-items": "flex-start",
                "margin-top": "20px"
            },
            "children": [
                {
                    "elmType": "div",
                    "txtContent": "References:",
                    "style": {
                        "font-weight": "bold"
                    }
                },
                {
                    "elmType": "a",
                    "txtContent": "TestName1",
                    "attributes": {
                        "target": "_blank",
                        "href": "TestLink1"
                    }
                },
                {
                    "elmType": "a",
                    "txtContent": "TestName2",
                    "attributes": {
                        "target": "_blank",
                        "href": "TestLink2"
                    }
                },
                {
                    "elmType": "a",
                    "txtContent": "TestName3",
                    "attributes": {
                        "target": "_blank",
                        "href": "TestLink3"
                    }
                }
            ]
        }
    ]
}

Output:

enter image description here

Make sure you are using correct internal name of your list columns in JSON. You can get the exact internal name of your columns by following this article: How to find the Internal name of columns in SharePoint Online?

2
  • 1
    Thanks a lot Ganesh, this one worked as I was imagining.
    – Beho86
    Commented May 22, 2023 at 12:15
  • You're welcome, glad it worked for you. Keep using this platform for asking questions anything related to SharePoint! Commented May 22, 2023 at 13:40

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.