A key feature of ChilliDB's search function is that it allows users to create their own filters to produce data collections that match their needs. For example, if they were wanting to create a filter that pulls out all contacts with the surname 'Smith'; or a filter that displays the number of new clients of a certain gender they received within a 3 month period; or a filter that displays all clients from a particular state; all of this and more is possible through the utilisation of the 'New Filter' option in the Search section of any ChilliDB module.
Note: The only proviso to this is that the field you are looking to include in the filter exists in the system first; and it is not stored in a grid section (i.e.: on of the tabs along the bottom of a ChilliDB record.
This article will walk through the basics of setting up a new search filter in ChilliDB, using the example above of the tracking of new clients of a particular gender over a 3 month period. It will also show users how to use both the simple and the more advanced filter options when setting up these filters. Finally, it will talk through the options at the top of the filter window when creating a new filter.
Creating a New Search Filter in ChilliDB
Step 1: Locate the 'New Filter' option in the 'Search' section of the relevant module.
This is done by navigating via the 'Search' option under the module's main menu to the search page. Once on the search page, select 'New Filter' to create your own custom filter.

When a user selects 'New Filter', they have two options in terms of how they go about putting their filters together. The first is the simple option. The second is more advanced and provides a greater choice in terms of linking options for fields; operators and so on. This article will provide a guide on how to create filters using both of these options.
Option 1: The Simple Filter
After clicking on 'New Filter' , the window that opens to allow users to add their filters for their search is defaulted to the simple filter option. This means that they will be able to add filters based on the fields available in their ChilliDB system, but there are none of the advanced options available here. It is a simple listing of filters from the relevant module.
This means that while this filter option is useful for filtering certain information from ChilliDB, it does have its limitations.
In the example below, we have run a search filter in the Contacts module for contacts of the type 'Client' who are from Queensland. The simple filter works well for a search like this where you are looking for single options within each field you are filtering for, providing that they are all supposed to be linked using an 'AND' rule as the system assumes this is the case.
When this filter is applied, the following search results appear in the Search Result List.

However, when we try to apply more complicated search terms to the simple filter option, there can be issues with getting the results we desire. In the example below, I have attempted to set up the filter for the tracking of new clients of a particular gender over a 3 month period that was mentioned above. The issue I have here is I don't have access to the operators that are available in the more complex version of these filters to set a range for the date I am looking for. As such, I am only able to search for a record that was created on a single date, instead of a 3 month period, which doesn't fulfil my search criteria.

The results of the above search are listed below. As mentioned, unless users do have a need to find records created on a specific date, this search filter doesn't give us the result we need in terms of the range (a 3 month period).

Option 2: The Advanced Filter
By clicking on the 'Show Filter Options' link in the top right-hand corner of the simple search screen, users can access the advanced filter options when creating a new filter.

Once the 'Show Filter Options' link has been clicked, users are taken to the screen below.

As we can see, a number of further options become available on this screen that allow users to interact with their field choices in different ways. These options are:
Filter Join: allows an 'AND' / 'OR' command to be added to dictate how the fields should be linked to each other.
Make Filter Group: lets users create groups of filters than are run as a single operation first before being combined with other filters in the search command.
Operator: allows users to select the relationship between the field and the value in the command. The options available here depend on the type of field you have added to your filter. For a full rundown on the operators available in ChilliDB's search filters and their functions, see our 'ChilliDB Search Operator Glossary' article.
Prompt for Value: checking this box means the value for this field will be selected when running the search from the module's search page. If this option is selected, users do not add a value on this screen. This is the best option to choose if values for certain fields in a search could vary.
How these options might be used in a search will be outlined further in the examples below.
To start with, we have added some of the fields that we are looking for data from to the search. We've added a filter for the field 'Type' (this is the record's main category) and made the value we am looking for equal to 'Client' via the 'Operator' dropdown. We've then added the 'Created Date' field to identify records that have been added to ChilliDB and used the 'Is Between' option from the 'Operator' dropdown so we can set a date range.
We have joined these two filters in the search with the 'AND' command, meaning we will only see search results that match the values set for both fields. However, the 'Gender' field is still missing, and we are going to use the 'Make Filter Group' option next to add the gender requirement to the search.

To create the filter group, we click on the checkbox under the 'Make Filter Group' column next to the 'Type' field filter that has been added. We then click on the 'Add Condition to Filter Group' link above the 'Type' field. This opens another row within that filter group in which we can add further fields. In this case, we have added the 'Gender' field to the search and set the operator for the value to 'Is Equal'.
We have also checked the box for 'Prompt for Value' for both the 'Gender' and 'Created Date' fields. This will allow us to allocate the value for these fields on the main search screen when we run this filter, meaning we don't have to edit the filter itself to see results for different values. We can simply change the values on the run and see the results for each (an example of this is provided later in this article).

Once the required fields have been added to the search filter, users have two options:
i) Apply Filter: this runs the filter and displays the results.
ii) Save filter: provides an option to save the filter for later use. When this button is selected, and dropdown reveals the option to either 'Save' the filter (if changes have been made to an existing saved filter); or 'Save As' for a new filter that has been created. When the latter option is chosen, a window opens that allows users to enter the details for the filter to be saved.
On this screen, users enter the name the filter is to be saved under and decide whether they want to save the filter as:
a) My Filter: this option means only the user themselves will see the filter for use when they go to the relevant module's search section.
b) Shared Filter: choosing this option allows users to share the filter with all other users in their ChilliDB system. This means when any user goes to the search section of the relevant module, they will have access to the filter for use.

Once the filter is applied or saved, the search results will usually appear on the Search Result List screen. However, in this case, we chose the option to 'Prompt for Value' for two of the fields we added to the filter, so those fields will appear at the top of the search results screen for the user to enter values in before the results are revealed. In the example below, we have the 'Gender' field and the 'Created Date' field at the top of the page with the option to choose/add the values we want before running the search. We have chosen 'Male' for the Gender field, and a 3 month date range for the 'Created Date' field so we can see how many new clients who were male were added during this period.
After setting the values and clicking the 'Search' button, we can see there was one new male client added during the period of the 1st of September 2023 through to the 1st of December 2023.

Note: Users need to be in a role with the ‘Shared filters modify’ ticket in order to add and edit shared filters. Without this ticket all filters are created under my filters and the option to create a shared filter doesn’t appear.

Filter Window Display Options
When creating new filters in ChilliDB, users can access a couple of options at the top of the filter creation window that allow them to dictate how the results of the filter are displayed.

i) Display Columns: this option allows users to select which columns they want displayed alongside their search results. After clicking on the 'Display Columns' link at the top of the page, users will be able to view the columns currently selected to display information alongside the search results (the 'Selected Columns'). They can also move the position of each field in the list with the up and down arrows alongside the field name or delete the field entirely by clicking on the 'x' button.
If users wish to add fields to the display columns, they can do so by clicking on the dropdown field highlighted in green in the screenshot below - this field typically defaults to 'Nothing selected' when the display column window first opens. Any field that is in ChilliDB from the module the search is being conducted under can be selected for the display columns here. Once a selection has been made, clicking on the '+' button adds it to the 'Selected Columns' list.

Once the selections for the display columns have been made, when the search is run, users will see the results from the filter displayed alongside the information from the display columns (highlighted in red below). In this way, simple reports can be designed in conjunction with the filters above, and these reports can then be exported in a variety of file formats.

Note: these changes can also be made by clicking on the cog icon on the top right-hand corner of the search results list - the cog above the 'Business Mail - State' column in the screenshot above.
ii) Sort Columns: this option allows user to set a default option for how the data provided by the search is sorted. After clicking on the 'Sort Columns' link at the top of the page, users will be able to view the columns currently selected to sort information alongside the search results (the 'Selected Sort Columns'). As with the 'Display Columns' option above, users can move the sort columns up and down the list with the arrows and / or delete a field by clicking on the 'x' button.
To add fields to the sort columns list, users do the same as with the display columns - choose a field from the dropdown that is to be added and then click the '+' button to add it to the 'Selected Sort Columns' list.

When the search filter is run, the column(s) added to the sort column list will automatically be sorted according to the user's instructions. In the example below, the 'Full Name' column has been sorted in descending order as per the settings in the screenshot above.

Note: users can also sort by a certain column simply by clicking on the column name - .e.g.: clicking on the 'Full Name' column heading above will sort the column in descending order alphabetically. Clicking it again will sort it in ascending order.
We hope you have found this Search: Creating Custom Filters article useful. If you have any further questions, please don't hesitate to get in touch, either through our Help Desk or by contacting us at info@chillidb.com
Comentarios