Forum Discussion

Harmon1590's avatar
Harmon1590
Copper Contributor
Oct 04, 2022

How to hide SharePoint list fields until after they are searched?

Hello, 

 

I am currently creating a SharePoint list to make an interactive and searchable database. I have established and inputted data via a List. However, I want to make the list only show the returned fields AFTER a user has conducted a search via SharePoint's search bar.

 

Some things I have researched and tried already:

-Filtering/formatting data options (doesn't work because I want the fields to return after a search is conducted, not just based on conditional formatting prior to search)

 

Any suggestions? Any help or ideas is much appreciated. Please reply if so! Thank you!

  • SvenSieverding's avatar
    SvenSieverding
    Bronze Contributor

    Harmon1590 

    I understand that you want our user to enter search data and to click on a search button, after that, the search results should be displayed.


    I would try to use a custom SharePoint Search Page for that.

    You would also be able to give your users additional guidance with more instructions on that custom page.


    If you have a server that supports SPFX/the modern experience than you could install the modern search webparts (https://microsoft-search.github.io/pnp-modern-search/)

     

    • Then create a new Page and add the "PnP Search Box" and then the "PnP Search Results" webpart.
    • Configure the Search Results Webpart to use SharePoint Search,
    • Change the Query Template to "Path:<URL to your List> {searchTerms}"
    • Change the Layout to List
    • Set the Search Results Webpart to Accept Data from the Search Box Webpart

    See more Information here:
    https://microsoft-search.github.io/pnp-modern-search/scenarios/create-simple-search-page/


    If you have an older SharePoint Server than you have to use the classic search webparts for the same effect.

Resources