Forum Discussion
SharePoint List - Hide Sections
When using JSON to format the layout of a SharePoint list and define sections. Is it also possible to use JSON to conditionally hide sections in the list based on the value of another field?
I tried something like this, but it does not appear to work:
{
"displayname": "Other",
"fields": [
"Form Status",
"Title"
],
"display": "=if([$Form_x0020_Status] == 'New', 'block', 'none')"
}
3 Replies
I've been using this type of JSON for a while and have been digging into it extensively the last few months. As far as I can tell from all the documentation, you can only conditionally show and hide the fields. I would love to be wrong here as hiding entire sections would make for a cleaner interface.
- kdf-srpmicCopper Contributor
Thanks for your response. I was able to conditionally hide the fields, but if those fields are in a section, then the section heading is still there with nothing in it, which looks stupid. I had hoped maybe my JSON was just bad, but maybe there is no way to do this.
- grant_jenkinsIron Contributor
Not much help in achieving what you are after, but a bit of context. I'm 99% sure that this used to work - if you had a section with 3 x fields and you conditionally hid those 3 x fields, the section wouldn't display because there were no visible columns. However, somewhere along the line (likely with the new Microsoft List updates) it now shows the heading regardless. Hopefully, someone at Microsoft will fix this.
There is also a large disconnect between the new List Form (where users without access to the list can still submit records) and the List View/New/Edit forms we have in SharePoint. I hope some of the new design changes start to come across, so they all align. I would love to see branching and even sections (similar to Microsoft Forms sections) be implemented in SharePoint.