Help/Suggestions with data filtering with multiple columns

I did this the other day.

on my page I have 2 text input fields (without a form)

<input type="text" class="form-control" id="filter_post_code" name="filter_post_code" placeholder="Filter: Post Code">
<input type="text" class="form-control" id="filter_email" name="filter_email" placeholder="Filter: Email">

Then I have a single Server Action with
Globals
$_GET (Right click > Add Variable) and name the variable exactly the same as the input id which is the same as the input name too
So mine looks like this
filter_post_code (Type > Text & Linked Field > BLANK)
filter_email (Type > Text & Linked Field > BLANK)

Then in Execute > Steps I have a Database Connection step and a Database Query that looks like this

SELECT * FROM AcConsumerDB WHERE acCdbAddressPostCode LIKE :&_GET_filter_post_code AND acCdbEmail LIKE :$_GET_filter_email

So basically in the columns area, I added my entire table, then in the conditions area I added the acCdbAddressPostCode field and set it to contains {{$_GET.filter_post_code}} AND acCdbEmail field set to contains {{$_GET.filter_email}}

Hope that helps, it is working perfectly
In my page I have 50k records and i add part of a UK post code like just RH and the records returned are about 900 and then I add part of the email address like sam and the records retuned come down to 4

1 Like