list view - json formatting not showing all items

Binu Thomas 171 Reputation points
2020-10-12T12:42:19.05+00:00

Hi All,

I am formatting a list view to display items as tile/card view using Json formatting. but it is showing only first 30 items. There is no option for paging and its not loading on the scroll down also. How can I solve this.

Below is the formatting I am using. Its displaying the user details based on a people field.

Thanks in advance.

{
"schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
"hideSelection": true,
"hideListHeader": true,
"rowFormatter": {
"elmType": "div",
"style": {
"float": "left",
"display": "flex",
"flex-wrap": "wrap",
"flex-direction": "column",
"align-items": "center",
"justify-content": "space-around",
"min-width": "300px",
"min-height": "286px",
"border-radius": "8px",
"margin-right": "10px",
"margin-bottom": "10px",
"box-shadow": "2px 2px 4px darkgrey"
},
"attributes": {
"class": "ms-bgColor-neutralLighterAlt ms-bgColor-neutralLight--hover ms-fontColor-themePrimary--hover"
},
"children": [
{
"elmType": "div",
"style": {
"text-align": "center"
},
"children": [
{
"elmType": "div",
"style": {
"font-weight": "500",
"font-size": "1.5rem"
},
"txtContent": "[$person.title]"
},
{
"elmType": "div",
"style": {
"font-weight": "300",
"font-size": "1rem"
},
"txtContent": "[$person.jobTitle]"
}
],
"defaultHoverField": "[$person]"
}
]
}
}

Microsoft 365 and Office | SharePoint Server | For business
Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

Answer accepted by question author
  1. Chelsea Wu 6,346 Reputation points Moderator
    2020-10-13T06:58:45.183+00:00

    @Binu Thomas

    As a workaround, you can create the Tile view with JSON definition added inside the property tileProps, then use the formatter element within tileProps property.

    Here is a sample script for your reference:

    {  
      "schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",  
      "hideColumnHeader": "true",  
      "hideSelection": true,  
      "tileProps": {  
        "hideSelection": true,  
        "width": "300",  
        "height": "286",  
        "formatter": {  
          "elmType": "div",  
          "children": [  
    	  {  
    		"elmType": "div",  
    		"style": {  
    			"float": "left",  
    			"display": "flex",  
    			"flex-wrap": "wrap",  
    			"flex-direction": "column",  
    			"align-items": "center",  
    			"justify-content": "space-around",  
    			"min-width": "300px",  
    			"min-height": "286px",  
    			"border-radius": "8px",  
    			"margin-right": "10px",  
    			"margin-bottom": "10px",  
    			"box-shadow": "2px 2px 4px darkgrey"  
    		},  
    		"attributes": {  
    			"class": "ms-bgColor-neutralLighterAlt ms-bgColor-neutralLight--hover ms-fontColor-themePrimary--hover"  
    		},  
              "children": [  
                {  
                  "elmType": "div",  
                  "style": {  
                    "text-align": "center",  
                    "margin": "auto"  
                  },  
                  "children": [  
                    {  
                      "elmType": "div",  
                      "attributes": {  
                        "class": "sp-row-title "  
                      },  
                      "txtContent": "[$Title]"  
                    }  
                  ]  
                }  
              ]  
            }  
          ]  
        }  
      }  
    }  
    

    It adds the Tiles view option to the list and allows you to show the tiles using the Tiles view.

    31952-screenshot-2020-10-13-144948.png

    Reference: How to create a Tile view on modern SharePoint lists.


1 additional answer

Sort by: Most helpful
  1. Chelsea Wu 6,346 Reputation points Moderator
    2020-10-13T06:21:52.927+00:00

    I can reproduce this issue in my SharePoint Online environment.
    If I have more than 30 items in the list, they all show when I first save the view formatting, but then display only the first 30 when I switch views or refresh the page.

    I have also found other posts reporting the same issue, according to which it is the "float": "left" style that is causing the issue:
    View with row formatter emulating tiles behaves incorrectly on paged list #108
    Elements in a list are not showing after applying custom formatting.

    I have tried changing "float": "left" to "float": "none"/"float": "right" or removing this line. None of these fixes the issue.
    It seems that this is a known issue in 'Tile' layout, and we do not have a solution for the time being.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    **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. **


Your answer

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