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")
Solved! Go to Solution.
@CNT Any clue what else I could look at to troubleshoot why mine isn't working?
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.
OH...and as to your original post problem, you can use search, but you can only search on Text columns. So if any of your columns are numeric or date or something else, then you need to convert to text.
Ex.
Search(
AddColumns([@BOE],
"_endDate", Text(End_x0020_Date, ShortDate),
"_startDate", Text(Start_x0020_Date, ShortDate),
"_sessionID", Text(Session_x0020_ID)
),
txtBOESearch.Text,
"Title", "Course_x0020_ID", "_endDate", "_startDate", "_sessionID"
)
However, as you pointed out, this is not delegable, so if your source (BOE) contains more than 2000 records, then you will start to get incomplete results.
But, if you can pre-filter the BOE table, then you could still do non-delegable functions on the prefilter without any issue.
@RandyHayes Great!! I will work on this tweak to accommodate as two of the fields are date fields and I would want mm/dd/yy or yyyy or partial date entries to be accepted.
Yes, the revised Search function that I provided would give you that functionality.
OR, if you're going with the Filter function, then change to:
Filter([@BOE],
txtBOESearch.Text in
Title & "|" & Course_x0020_ID & "|" & Text(End_x0020_Date,ShortDate) & "|" & Text(Start_x0020_Date, ShortDate) & "|" & Session_x0020_ID ||
IsBlank(txtBOESearch.Text)
)