Search inside table result

I have table which get data from DB based on query . i needed to filler data result on that table based on text entered in text filed .
Means ,Search on the result of the query .as per below i need to enter (TestRow17) and once press entered . table will be updated and showing only all rows have same value

The easiest is probably to use a script for this:

  • Define the query on a custom property on the text field (instead of directly on the data property of the table)
  • Use a “propertyChange” script on that text field; execute the script whenever the “text” property, or your custom dataset changes
  • Loop over the dataset, and copy wanted rows to a new dataset
  • Write the dataset to the table

Why don’t you modify your query?
For example, if your query is SELECT * FROM yourTable,
change it with SELECT * FROM yourTable WHERE Col2 LIKE '%{Root Container.Text Field.text}'
So it will filter on Col2 and if nothing is specified inside the TextField you’ll see all the results.

1 Like

Already did it . but due to certain need . first we need to see the result based on time after that we need to search on certain data.
this why i looking for search on the result not run new query .

If the issue isn’t a performance issue (f.e. if you have performance problems with the DB, and want to use caching), then including it in the query is the better option indeed.

You can easily search on multiple fields by combining them with AND and OR as needed.

1 Like

Or use concatenation in the WHRE clause, e.g.

FROM some_table
CONCAT_WS('_', filterCol1, filterCol2, filterCol3) LIKE CONCAT('%', YOUR_FILTER_VALUE, '%s')

Works with Microsoft SQL and MySQL don’t know about other db’s. The CONCAT_WS function can be replaced with a normal CONCAT if not supported.

The seperator in CONCAT_WS should be replaces with a non-valid search char.

1 Like