cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

Exclude a string from gallery search

Hello

         I am looking for a simple way to exclude a certain text string from a gallery search results box. 

 

I am currently using 

Search(datasource,SearchInput.Text,"FullName")

Which works as intended to return results based on what the user types into the search field. 

However i have some users that are added to the data source temporarily that i do not want showing up in the search. These users all have the same "FullName" as TEMP. 

Is there a way to search the data source by what the user types in but exclude any results that match the string "Temp"?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Exclude a string from gallery search

You can combine Filter and Search with something like this:

Search(Filter(datasource, !('Full Name' = "TEMP"),SearchInput.Text,"FullName")

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit(Haman)

View solution in original post

3 REPLIES 3
Highlighted
Super User
Super User

Re: Exclude a string from gallery search

You can combine Filter and Search with something like this:

Search(Filter(datasource, !('Full Name' = "TEMP"),SearchInput.Text,"FullName")

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit(Haman)

View solution in original post

Highlighted
Resolver I
Resolver I

Re: Exclude a string from gallery search

Thanks @PowerAddict I had to modify your code just a little but it works great thank you. Nothing to major just had to add a extra  parenthesis after "Temp".

 

 

Original 

Search(Filter(datasource, !('Full Name' = "Temp"),SearchInput.Text,"FullName")

Modified

Search(Filter(datasource, !('FullName' = "Temp")),SearchInput.Text,"FullName")

 

Highlighted
Super User
Super User

Re: Exclude a string from gallery search

Yea my bad. Glad it worked!

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,735)