Searching within a view element with a Search field
I have a view element on a page. I would like to be able to search within this view. I have created a search field named Search. However, I am unable to perform the search. The code I inserted into the view is as follows:
let search := Search;
if search != "" then
select Products where contains(lower(text(Brand)), lower(search))
else
select Products
end
Unfortunately, this does not work. My view remains empty (but it is populated if I enter select Products).
What am I doing wrong?
Thank you
4 replies
-
I'm not sure what you mean by:
(but it is populated if I enter select Products)
You may want to try changing line 2 to:
let search := Search; if search then select Products where contains(lower(text(Brand)), lower(search)) else select Products endLine 2 now says if search has data, or is not null, then...
-
It works. Thank you.
-
Another approach is this:
let mysearch := Search;
select Products where not mysearch or Brand like mysearch
Content aside
- Status Answered
- yesterdayLast active
- 4Replies
- 25Views
-
3
Following
