cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JTischler
Helper II
Helper II

Keyword search on multiple columns

I have seen several posts on this topic, but none fit my use case.  I have a gallery connected to a SP list.  I have put in text input box and am referencing that in my search code.  I am not concerned with sorting, I just want to be able to type in one part of a variety of data points and have the list item display, so STARTS WITH is not an option for me. 

 

in the below code the search works perfect when just 'Title' and "Course_x0020_ID" stated.  if I change either of those or add on additional columns to search in, the gallery disappears and it says I have an error.  How can I search in the 5 columns I show in the code below? Also - this list could grow to larger than 500, I have seen some limitations around capacity.  I welcome feedback to work around the capacity issue

 

My list name is: BOE

 

Search([@BOE],txtBOESearch.Text,"Title","Course_x0020_ID","End_x0020_Date","Start_x0020_Date","Session_x0020_ID")

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@JTischler 

Your formula is not correct, change to:

Filter([@BOE], txtBOESearch.Text in Title ||
	txtBOESearch.Text in Course_x0020_ID ||
	txtBOESearch.Text in End_x0020_Date ||
	txtBOESearch.Text in Start_x0020_Date ||
	txtBOESearch.Text in Session_x0020_ID
)

 

You can also shorten and resolve the blank search with:

Filter([@BOE], 
   txtBOESearch.Text in 
    Title & "|" & Course_x0020_ID & "|" & End_x0020_Date & "|" & Start_x0020_Date & "|" & Session_x0020_ID ||
   IsBlank(txtBOESearch.Text)
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

14 REPLIES 14
CNT
Super User
Super User

@JTischler You can use the in operator,

Search([@BOE],"Title" in txtBOESearch.Text ||
	"Course_x0020_ID" in txtBOESearch.Text ||
	"End_x0020_Date" in txtBOESearch.Text ||
	"Start_x0020_Date" in txtBOESearch.Text ||
	"Session_x0020_ID" in txtBOESearch.Text
)

Thanks @CNT , I was trying that method earlier but couldn't get the syntax right.  Unfortunately that doesn't work either.  It says there aren't enough arguments and also I again get the error about not recognizing the identifier.  Once I comment out the extra identifiers, you can see the data populates again. Please check the attached screenshots.  Thanks much!!

@JTischler Oops! Got to use the Filter function,

Filter([@BOE],"Title" in txtBOESearch.Text ||
	"Course_x0020_ID" in txtBOESearch.Text ||
	"End_x0020_Date" in txtBOESearch.Text ||
	"Start_x0020_Date" in txtBOESearch.Text ||
	"Session_x0020_ID" in txtBOESearch.Text
)

@CNT That did resolve all the errors, but now I am back to the problem of no data displaying which was the original problem.

@JTischler Did you type anything in the txtBOESearch TextBox?

@JTischler Try revising it,

Filter([@BOE], txtBOESearch.Text in "Title" ||
	txtBOESearch.Text in "Course_x0020_ID" ||
	txtBOESearch.Text in "End_x0020_Date" ||
	txtBOESearch.Text in "Start_x0020_Date" ||
	txtBOESearch.Text in "Session_x0020_ID"
)

@CNT I did, and nothing displayed.  Initially with a blank search box all items should display, but nothing does.  In my original formula if I limited my criteria to title and course ID then I could see the list item.  As soon as I added more criteria, then the item disappears.

@CNT That revision made progress, it does allow the list item to populate, but as soon as I enter anything in the search box, the item disappears.  I have tried partial and exact with no results

@JTischler I tried with an example and it works,

 

CNT_0-1629234405614.png

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,682)