Search fields / search query in a list and webpart

Copper Contributor

I would like to know if it is possible to create a search box on a sharepoint page and if so, how to do it?


The idea would be to allow the integration on a site page of a "search field" (i.e. a search area to be filled in) which would check if the element is present in a list.


For example, I have a client list.
Before creating a new customer, the name is entered in a search field and this checks the correspondence in a list.
If the customer is existing, we receive a message with a link, for example, to the item in the list

4 Replies

Hello @EiC4733


you can use a SharePoint Search Box to search a list. It's my preferred solution to configure a custom search page for this case. For SahrePoint Online you can use the PnP Modern Search WebParts: 

For classic, it's a WebPart, SharePoint Search Box, available.


Or with this guide you can create your search box:


Regards, Dave

best response confirmed by EiC4733 (Copper Contributor)

@David Mehr 

Thanks a lot,

This is exactly what I was looking for. I still have to get started with the tool to be able to configure the search in a very specific list.


thanks again

Given my skills and my bad English, could you provide me more details on how to configure pnp search to fix the search in a specific library or list and not in the whole site?

Hello @EiC4733 


add a new search page with a Search Results Web Part:


When you edit the Results Web Part, you can configure the query unter Query Template (page 1 in Web Part configuration). Your Query looks like this:

{searchTerms} path:https://<TENANT> IsContainer<>true


path: is the direct path to your library

IsContainer<> exclude folders, when you don't have folders, you can delete the parameter IsCointainer<>true


On page 3 in your Result Web Part, you can connect to an Search Box, when you use both.


Hope this helps.


Regards, Dave


**When you like my work, mark as best answer and give a like to the answer