Tuesday, February 16, 2021

Filemaker Making Progressive Limits

 It is not unusual for performing progressive limits. Basically it is just to limit the search by selecting various attributes of the item. For example, in a electronic product, you would want to limit to hand phone, Xiaomi, 4 GB Memory, 256 GB storage to find the price of item that match the criteria. Its like setting filters as you browse the products. 

Most on-line product sellers would allow for filters. Here, the idea is to do it in FileMaker which does not have dynamic content and have difficulty in doing paging without resorting to web based techniques.

Doing filters in FileMaker is not that easy. as lists are not set dynamically according to selected fields. Using SQL to filter is also not that easy as user select different options in various fields.

Below is a simple method of doing progressive filtering. The key in doing that is to force user to select various options in a fixed sequence/

Using the model mentioned above, there are three filters. 1. Model, 2. RAM, 3. Storage. Obviously, in real products there are much more options to choose but for simplicity, only 3 options are shown here.

STRUCTURE

One main table where the filters are set.

One product price table where the Model, Ram and Storage are set.

METHOD

Create a field for each filter in the main table.

Create a list based on Model on the product price table and set "Model" field to select from this list.

In the database Relations tab, create a duplicate product price table. Set the "Model" field of main table to the "Model" field of the price table. Create a list from this duplicate and set it as select list to "RAM" field of the main table. Hide the "RAM" field if "Model" is not selected.

In the database Relation tab again create a second duplicate of the price table. This time Set the "Model" and "RAM" field of the main table to the "Model" and "RAM" field of the price table. Create a list from the second duplicate. Hide the "Storage" field if any of the "Model" or "RAM" is not selected.

In the database Relation tab again create a third duplicate of the price table. This time Set the "Model", "RAM" and "Storage" field of the main table to the "Model", "RAM" and storage field of the price table. Create a script to set the "Price" field of the main table to the "Price" field of the third price table.

In this way the fields are chosen progressively according to the order of the available fields. This relation setting allows user to change various options easily. You only need to ensure that the "Price" field of the main table is blank first every time user make changes on any of the fields unless you want to make the field as the "Price" in the third price table without the script.