cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
stephenJames
Level 8

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
PowerAddict
Level 10

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
PowerAddict
Level 10

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

stephenJames
Level 8

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")

 

PowerAddict
Level 10

Re: Exclude a string from gallery search

Yea my bad. Glad it worked!

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,000)