Forum Discussion

mziemba's avatar
mziemba
Copper Contributor
Sep 19, 2022

SharePoint list and Galery view with links to filtered sub list

Hi,  I've created an SharePoint list of programs and have a separate list of projects, where each project refers to a program (it has a lookup column to a program list).  I have found an inspiratio...
  • ganeshsanap's avatar
    ganeshsanap
    Sep 22, 2022

    Michal_Z Below JSON works for multiple fields: 

     

    {
        "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/tile-formatting.schema.json",
        "height": 123,
        "width": 254,
        "hideSelection": true,
        "fillHorizontally": true,
        "formatter": {
            "elmType": "div",
            "attributes": {
                "class": "sp-card-container"
            },
            "children": [
                {
                    "elmType": "a",
                    "style": {
                        "text-decoration": "none"
                    },
                    "attributes": {
                        "class": "ms-bgColor-white sp-css-borderColor-neutralLight sp-card-borderHighlight sp-card-subContainer",
                        "target": "_top",
                        "href": "='https://company.sharepoint.com/teams/ProjectManagement/Lists/Projects/GroupedByProgram.aspx?viewid=a5d9b369%2Df9db%2D498b%2Dbd43%2Df339dd030bd1&?FilterField1=Program%5Fname&FilterValue1=' + [$Title] + '&FilterType1=Lookup'"
                    },
                    "children": [
                        {
                            "elmType": "div",
                            "attributes": {
                                "class": "sp-card-displayColumnContainer"
                            },
                            "children": [
                                {
                                    "elmType": "p",
                                    "attributes": {
                                        "class": "ms-fontColor-neutralSecondary sp-card-label"
                                    },
                                    "txtContent": "[!Title.DisplayName]"
                                },
                                {
                                    "elmType": "p",
                                    "attributes": {
                                        "title": "[$Title]",
                                        "class": "ms-fontColor-neutralPrimary sp-card-content sp-card-highlightedContent",
                                        "role": "heading",
                                        "aria-level": "3"
                                    },
                                    "txtContent": "=if ([$Title] == '', '–', [$Title])"
                                }
                            ]
                        },
                        {
                            "elmType": "div",
                            "attributes": {
                                "class": "sp-card-lastTextColumnContainer"
                            },
                            "children": [
                                {
                                    "elmType": "p",
                                    "attributes": {
                                        "class": "ms-fontColor-neutralSecondary sp-card-label"
                                    },
                                    "txtContent": "[!URL.DisplayName]"
                                },
                                {
                                    "elmType": "p",
                                    "attributes": {
                                        "title": "[$URL]",
                                        "class": "ms-fontColor-neutralPrimary sp-card-content "
                                    },
                                    "txtContent": "=if ([$URL] == '', '–', [$URL])"
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    }

     


    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.

Resources