Defining filter presets to search records
Filter presets are predefined filters used to search records in an application.
As a developer or application business analyst, you can use partial strings, wild characters, or logical operators that give more control in creating filter presets with specific search criteria. You can then use the filter presets at run time in an application. This helps in improving the system performance because only those records that match the search criteria are loaded at runtime.
Types of filter presets
BMC Helix Platform supports the following types of filter presets:
- Built-in filter presets —Use partial strings and wild characters to define these filter presets.
Shared filter presets—Enter a qualification in the Record Grid Filter Presets record definition to define these filter presets. You can use multiple conditions by using logical operators such as AND, OR, NOT, and so on. By default, these filters are applied when a page is loaded. As a developer or application business analyst, you can apply different filter presets after the page has loaded.
Because the shared filter presets are created and maintained outside the view definition (UI design), you can create them even if the view definition is locked for customization.
- My Presets—Define these filter presets at runtime for yourself. These filter presets are displayed only to you and are stored in your user preferences.
How filter presets work
- If you've created a default built-in filter preset, it takes precedence over any other filter preset.
If you've created multiple default shared filter presets, the filter presets are applied based on the value in the Filter Display Order field. As a developer, you must make sure that the values in this field are entered appropriately.
Example of how multiple default shared filters work
You created the following shared filter presets, set their Filter Display Order, and marked each as default preset:
Shared filter preset Filter Display Order Is Default Preset A 1 Yes Preset B 0 Yes Preset C 2 Yes
Runtime behavior—Preset B with Filter Display Order = 0 is applied first followed by preset A and preset C.
Before you begin
Make sure that you have created a view definition with record grid in which you want to create the filter presets. For more information, see Creating a tabular view of record instances by using a record grid.
To create built-in filter presets
- As an application business analyst or a developer, log in to BMC Helix Innovation Studio and navigate to the Workspace tab.
- Select the application in which you want to create the filter preset.
- On the Views tab, click the name of the view definition to which you want to create the filter preset.
- In Properties, click
and then click Add/Remove Filter Presets.
- In the Add/Remove Filter Presets dialog box, click New Filter Preset and enter a preset name.
Click Filter and select the filters for your preset.
Example: You want to create a filter preset so that the record grid displays only those records that are assigned to assigned to Smith and users whose names end with son.
For text filters, you can enter partial strings with the % wildcard. The % wildcard filters all the records that fully or partially match the text string entered by you.
The following image shows the filters selected for this example:
- (Optional) In Default Filter Preset, specify the filter preset that you want to set as default.
This filter preset takes precedence over any other filter presets that you have created.
- To open the record grid, click Preview.
- In the record grid, click
and then select the filter preset you just created.The record grid now displays records filtered according to the selected filter preset, as shown in the following image:
To create shared filter presets
As an application business analyst or a developer, log in to BMC Helix Innovation Studio and navigate to the Workspace tab.
Select the application in which you want to create the filter preset.
- To open the Record Grid Filter Presets record, in the URL, replace the strings after the application bundle name with record-data-editor/Record%20Grid%20Filter%20Presets.
For example, http://machine name/innovationstudio/index.html#/app/bundle/fully qualified bundle name/record-data-editor/Record%20Grid%20Filter%20Presets
Create a new shared filter preset and fill out the following fields:
Field Description Example Application ID Type the fully qualified name of the application in which you want to add the filter preset. com.bmc.dsm.case-lib Created By Do not make any changes. NA Description Describe the filter preset so that it is easily identified. Filter preset with assignee, status, and monthly time range. Filter Expression
Specify the expression based on which you want to filter the records. Format of the expression: 'Field ID' = "value" AND 'Field ID' = "value" OR 'Field ID' = "value"
Important: The expression within the shared preset filters is immutable. To avoid run time errors, if you delete a field from the record definition, you must update this expression.
Best practice: The expression is not validated until it is rendered at run time. We recommend that you test the expression before moving from development or testing environment to the production environment.
If you want to search for cases that are assigned to Smith and are Open in the previous month, you can specify:
'8'="Smith" AND 'Status' >="1000" AND $TIMESTAMP$ - 'Created Date' <= 2592000
Name Specify a name for the filter preset that is displayed for the users at run time. You can enter a localized name for this filter preset. Open cases assigned to Smith in August. Record Grid GUID Type the GUID of the record grid in which you are adding the filter preset. a122b3c4-dd5e-6f7g-ah0a-9069ij558k8l Status Do not select anything. NA Assignee Do not change the existing value. NA Filter Display Order Specify the order in which you want to apply the filter preset. 0 Is Default Select to mark this shared filter preset as default. If you create multiple shared filter presets, they are applied at run time on the basis of the Filter Display Order, as explained in this example. NA
The shared filer preset is added to the specified record grid.
To create My Presets
As an application business analyst, developer, or administrator, you can define a My presets filter and save it at run time. This option is helpful if you work with an application on a daily basis, and you want the records to be filtered in a certain way.
- Log in to the application in which you want to create the filter preset.
- On the records grid, click and then select the filter preset that you want to set.
- Save the preset.
To filter records at run time by using filter presets
As an application business analyst, developer, or administrator, if you have access to the view at run time, you can use filter presets to search for records.
- Log in to the application in which you created the filter preset.
For example, BMC Helix Business Workflows.
- Navigate to the record grid in which you created the filter presets.
For example, Cases.
Click Filter Preset, and select any one of the following types of presets to use to filter records:
If shared or built-in filter presets are not created, only the My Presets section is displayed.
The following image is an example of how filter presets are displayed at run time:
The records are displayed based on the filter preset you selected.
Defining the user interface through view definitions
Log in or register to comment.