Forum Discussion
Hide a list webpart in page Sharepoint if the list is empty in Pages
Hello Davidllem
this settings is not available on list or document web part.
Other ways:
- Use the list with a View Formatting (as example: https://adoption.microsoft.com/en-us/sample-solution-gallery/sample/pnp-list-formatting-announcements/?WT.mc_id=DX-MVP-5004845 )
- Use an highlighted content webpart, in there you have the setting "Hide this web part if there's nothing to show"
- Or use PnP Modern Search Results Web Part also with the setting "Hide this web part if there's nothing to show" (https://microsoft-search.github.io/pnp-modern-search/ )
I think in your case the first entry can help you, it's easy to implement.
Best, Dave
- mcadsFeb 12, 2024Copper Contributor
DaveMehr365 Can you add the code here that hides the List Webpart if it is empty using Json? I'm having a hard time finding it in the example you added. (https://adoption.microsoft.com/en-us/sample-solution-gallery/sample/pnp-list-formatting-announcement...)
Thanks!