Create a View to Filter a Table
As your database grows more complex you may find specific needs that can be answered by creating a view. Views can be used to filter a very large table making the structure and record count more manageable. Views can also be used to join multiple tables. Joining more than one table makes the record information from all of the tables accessible in a single record. You can filter a table and join multiple tables in the same view. This article will explain how to use a view to filter a table.
Why filter a table?
Using a view to filter a table can have many applications. As mentioned above, it is a good way to reduce the number of records and fields to only those essential to your current task. Another common use is to apply a filtered view to an authentication table. A view can be configured to remove records based on a number of criteria. Filtering views is an efficient way to have end-user accounts automatically removed from an authentication table after a certain number of days.
In this example we will be removing end-user accounts from a view if their record’s “RELS_Agents.Active” field is unchecked.
Steps to make a filtered view:
1. Open the View wizard
In the Caspio Bridge Explorer window, go to the Views section and click on the New View button. This brings up the View wizard.
2. Name your view
Enter a name for your view. Only letters, numbers and underscores are accepted (no special characters, spaces, or punctuation). View names must begin with a letter.
3. Select the table you’d like to filter
Select the desired table from the provided list. Click Next.
4. Remove any unnecessary fields
In the Field Properties screen, configure the filter that will remove unwanted records. By default your view fields are renamed by combining the name of your table followed by a period and finished by the original field name. You can hide entire fields by un-checking the “Include field in View” checkbox.
Configure your filter
The second checkbox allows you to “Filter data by this field”. Enter the comparison type and the value to create a filter. Date/Time also allow you to choose a specific Precision value. If the record passes this test, it will be included in your view. Yes/No fields allow you to filter records based on their value. For example, to make records with the “RELS_Agents.Active” field checked appear in the view, you would set your comparison type to Equal and set your value to “Checked”.
Click Finish and Close to save your view.