Using SharePoint List custom view with List Properties web part

Mandy Sal 21 Reputation points
2023-06-06T01:05:17.66+00:00

I have a SharePoint list that has a few custom views. I have used JSON to format list view. On a SharePoint page, I have inserted two web parts: 1) a custom view of my SharePoint List; 2) List Properties connected the my List as its source. List Properties only works when I revert back to the standard view of my List. It displays nothing when I interact with the custom view. Is this happening because I am using a custom view or because I have used JSON to create/format a custom view?

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

Accepted answer
  1. Ling Zhou_MSFT 18,935 Reputation points Microsoft Vendor
    2023-06-07T06:07:42.0433333+00:00

    Hi @Mandy Sal,

    Please change the value of hideSelection to false.

    "hideSelection": false
    

    Because after you set the value of hideSelection to true, you have no way to select an item, the List Properties does not know which item you want to display, so the content will not be displayed.

    Here is the result of my test. Click the radio button in the upper right corner to select the item.

    User's image


    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 additional answer

Sort by: Most helpful
  1. Mandy Sal 21 Reputation points
    2023-06-06T16:18:08.1+00:00

    Here is a screenshot of the the list and list properties web parts next to each other. I am able to connect to the source, but when I click on any of the numbered boxes nothing shows in List Properties. When I change the view of my list to Allitems (standard view), then list properties works. I'm also including the JSON list view formatting script.

    {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/tile-formatting.schema.json",
      "height": 53,
      "width": 254,
      "hideSelection": true,
      "fillHorizontally": true,
      "formatter": {
        "elmType": "div",
        "attributes": {
          "class": "sp-card-container"
        },
        "children": [
          {
            "elmType": "a",
            "attributes": {
              "class": "sp-card-defaultClickButton",
              "role": "presentation",
              "href": "='#tool_' + @rowIndex"
            }
          },
          {
            "elmType": "div",
            "style": {
              "background-color": "=if([$CotStatus] == 'Occupied', 'rgba(231,84,128)', if([$CotStatus] == 'Needs cleaning', 'rgba(235,156,92)', if([$CotStatus] == 'Vacant', 'rgba(146,210,147)', 'rgba(255,255,255,0.3)')))",
              "border": "1px solid #eeeeee",
              "border-radius": "10px",
              "padding": "15px"
            },
            "children": [
              {
                "elmType": "div",
                "children": [
                  {
                    "elmType": "p",
                    "attributes": {
                      "title": "[$Title]",
                      "class": "ms-fontColor-neutralPrimary sp-card-content sp-card-highlightedContent"
                    },
                    "txtContent": "=if ([$Title] == '', '–', [$Title])",
                    "style": {
                      "text-align": "center"
                    }
                  }
                ]
              }
            ]
          }
        ]
      }
    }
    

    list properties

    0 comments No comments

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.