Jul 20 2022 02:50 AM
Hello,
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
Aug 04 2022 01:28 AM
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: https://microsoft-search.github.io/pnp-modern-search/scenarios/
For classic, it's a WebPart, SharePoint Search Box, available.
Or with this guide you can create your search box:
https://www.codesigned.com/blog/how-to-create-a-custom-sharepoint-search-box-jquery
Regards, Dave
Aug 04 2022 05:31 AM
SolutionThanks 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
Aug 04 2022 08:02 AM
Aug 05 2022 01:56 AM
Hello @EiC4733
add a new search page with a Search Results Web Part: https://microsoft-search.github.io/pnp-modern-search/scenarios/create-simple-search-page/
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>.sharepoint.com/sites/DocumentStore/TechContent/ 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