Search Text Field / Syntax help

I have a main table, with many text fields that can be written to the table. I’m attempting to add a filter to the column, I am attempting to achieve this by adding a WHERE tag = {Root Container.Search.search}

The " Search" custom property is to either be null if search = empty , or to write the rest of the where string AND tag = Container.Search.text} .

Two main issues, 1.) I do not know the proper syntax to write the string, it keeps printing the {root container.Search.txt} versus, what is in the text box,
2.) Not even sure if this idea will work for a search bar.

Code of the custom property:
if({Root Container.Search.text}="","",“AND e.tag = {Root Container.Search.text}”)

Im basing my answer in perspective but the same applies to vision, I’m also assuming your search box is a text field box.

This is how I do it to enable wild cards on the search.

On the text field box create 2 custom properties. One called ‘whereclaus’ and one called ‘keyword’

The whereclaus expression is (Description is my database field)

if ({this.custom.Keyword}='',
	"Description >= ''",
	concat("Description LIKE '",{this.custom.Keyword},"'")
	)

The keyword expression is

{this.props.text}

but it has a transform expression of

'%'+{value}+'%'

Now, in your sql query / Named query (in my case) I add ‘Description’ as a Query String
and use the following as an example…

SELECT DATE_FORMAT(Date, "%m-%d-%Y") AS 'Date', 
RequestNumber As 'Request Number',
PONumber AS 'P/O',
ProjectNumber As 'Project No',
Supplier,
Requester,
DeliverTo As 'Deliver To',
PartNumber As 'Part No',
Description,
Qty,
PriceEach As 'Cost Each',
TotalCost As 'Line Cost'
From order_requests
WHERE Status = 'Ordered'
AND {Project}
AND {Supplier}
AND {PartNumber}
AND {ReqNumber}
AND {Description}
AND {Classification}
Order by id Desc

With the %% as part of the expression, as soon as you type a letter it will start matching everything with that character.

I forgot to add, Dont forget to go back to your table query and add the whereclaus you just created on the text field in the table parameters.