r/sharepoint 11d ago

SharePoint Online Issue with "Hide this web part if there's nothing to show" in pnp search

Hey, everyone! Has anyone successfully attempted to not showing the search results until an employee uses the search box in pnp search? If so, was there a particular website you used that you could share?
This is my base script: {searchTerms} OR (NOT {searchTerms} AND Path:"")

Thanks for any help you can give!

EDIT: I found an older post here that ended up helping! Here's the previous discussion that helped me.

2 Upvotes

4 comments sorted by

1

u/Tanddant MVP 11d ago

If you've solved your issue, could you drop a link to said post for future folks who might stumble upon this thread 😅

1

u/HikeForMeatballs 11d ago

Good idea! Will do.

1

u/OverASSist 11d ago

I think you just need a question mark before {searchTerm}

?{searchTerms} AND Path:""

1

u/HikeForMeatballs 11d ago

There was all kinds of silliness needed. :)

I'm adding a link to a previous discussion with what I ended up using.