Hi!
Filters are expressions that are evaluated against each repeater row, and must evaluate to either true or false. If the expression evaluates to TRUE for the row, the row is displayed. Otherwise, the row is not displayed.
I’d first start by figuring out how to use local variables in an expression if you don’t already. (A filter is a sort of an expression.) Basically, local variables allow you to refer to properties of other objects, in your case, the dropdown’s selected option and the text field’s value. Here is a good place to start.
Also, you will need to know about the function indexOf(). This function tells you the location of one text string within another string. So if LVAR is a variable containing the string “abc” then LVAR.indexOf(‘a’) would return 0, LVAR.indexOf(‘b’) would return 1, and LVAR.indexOf(‘c’) would return 2. However, LVAR.indexOf(‘z’) would return -1, meaning “not found.”
So if you want to find out if LVAR contains “a” the expression would be LVAR.indexOf(‘a’) >= 0, since any non-negative value would cause this expression to evaluate to true. (>= is a comparison operator meaning greater than or equal to.)
If you want to find out if LVAR starts with “a” the expression would be LVAR.indexOf(‘a’) == 0, which would evaluate to true assuming the position of ‘a’ in LVAR is 0. (== is a comparison operator meaning equal to.)
This file shows two ways of solving this puzzle, each on a different page. The first conditionally applies a filter depending on which option is chosen in the dropdown, deleting any previous filter that was there. The second uses a single filter that is applied OnPageLoad, and then that filter is simply forced to re-evaluate when the filter button is pressed.
You’ll note these examples are case-sensitive; you’d have to enter T rather than t to find the t in Terrier. I added a third page showing how to do method 1 in a case-insensitive way.
filtering_exampe.rp (92.2 KB)