[00:00]
In this lesson, we'll demonstrate how to apply dynamic filtering to the results returned by a DB Browse Binding. To recap the prior lesson, we use DB Browse Binding to return all 40 records for first name, last name, and email into this table. The data was sorted A to Z on first name that was no filtering of the data done. We achieved this data retrieval by selecting the table clicking on its data binding and selecting the DB Browse Binding here. We selected the first name, last name, and email for display. The DB browse binding type also allows us to do filtering of data. Whereby we can add one or more key columns to search for particular records meeting some criteria. In this case, we're going to make use of this store_id column where the values are either one or two. We have customers in store one and customers in store two. We're going to make use of this data back on our Designer view. We've added a drop-down list to our view and in Preview Mode, we can see that its options are going to be store one and store two. Now, behind the scenes, of course.
[01:15]
If we go to the data, we'll see that the customer ID values of one or two are what will actually use in the query. So let's return to our table's DB Browse Binding. Here we'll select the store ID and click on this little key icon. Now we see the store ID added as a key column with a specified value for filtering data. We can change the value to something else and we see that the select query is updated accordingly. But remember we still want to return the first name, last name, and email. So we will reselect those three columns and see that the query is updated accordingly where once again returning the first name, last name, and email for a specified store ID value. So finally rather than hard coding a value like this we prefer to set up a binding between this key column back to the drop-downs selected value on the screen this way the drop-down value gets used in the query making it dynamic. Note that if we wanted to we could use multiple selection criteria in our query bound to multiple screen components. So we'll click on this property binding icon, navigate down to the drop-down component. Then its Selected Value property and click OK and OK again for the DB Browse Binding. Once we do that, we see a subset of 23 records returned for store one and then if we go to Preview Mode and select store two we see the other 17 rows out of the original 40 records. So to recap this lesson we've seen how to add some dynamic filtering on a DB Browse Binding to a database table.