While managing data sets, you can define pre-applied filters to be used in the data set fragment. Although you can set those filters, users can change their parameters anytime.
For any type of filter, clicking Select under the Filter By field opens the Select Field pop-up, with a tree view that includes all fields for the selected entry type. For object entry types, you can also expand parent or related entry fields (such as a related object’s fields).
Warning
Whether you can filter on a field depends on the associated API’s filtering capability. Some fields do not support filtering even if you can select them. Find the API in the API Explorer and check whether the query works with a $filter parameter to confirm the capability.
The chosen type of filter determines which fields in the tree are selectable:
Client extension filter: Any field is selectable. The client extension’s implementation determines how the filter is applied.
Date range filter: Only date fields are selectable. The user can change the date range from the default when selecting the filter.
[Selection filter](#selection filter): Only string or numeric fields are selectable.
Selecting a field that belongs to a related entry can be useful for more complex filters. For example, if you have a Student object with a relationship to a School object, you can filter a Student data set by the related School’s schoolName field. If the user selects the name Stanford University, this filter expression automatically applies: filter=(studentsAtSchool/schoolName+eq+'Stanford+University').
Warning
Only object endpoints support selecting related or parent entry fields. The automatically generated filter syntax for other kinds of endpoints (such as /o/headless-* endpoints) does not work for filters using related entries’ fields.
You can also activate or deactivate filters after you add them, via the buttons in the Status column. When a filter is inactive, it no longer available for users until you reactivate it.
Deactivate data set filters instead of deleting them so you can reactivate them again later if needed.
Use API REST endpoints or picklist options as parameters for the filter.
Note
Filters selected from picklists are not applicable to integer fields because picklist keys are strings, which are incompatible for comparison. The API performing the filter requires the unique key to filter by.
Start by choosing Selection when adding a new filter. The Selection filter has three sections: Configuration, Filter Source, and Filter Option.
Under Configuration,
Fill in the Name of the filter and, optionally, localize it.
Configure the Filter Source to determine the values offered in the filter. Choose an Object Picklist or an Liferay DXP 2024.Q3+/Portal GA125+ API REST Application to associate with the filter.
With Object Picklists, choose a picklist to associate with the filter.
Liferay DXP 2024.Q3+/Portal GA125+ With API REST Applications, select a REST Application, REST Schema, REST Endpoint, Item Key, and Item Label.
Tip
The Item Key and Item Label define which fields of the API response are used to build the filter. The Item Key constructs the OData object as a filter parameter, and the Item Label displays the values in the filter UI. Since APIs can return a wide range of data, specifying these fields is crucial for proper integration and data handling.
Under Filter Options,
Preselect values for the filter.
If you choose the Single selection option, you can only preselect one value.
Determine if users can select multiple or single values.
This website uses cookies and similar tools, some of which are provided by third parties (together “tools”). These tools enable us and the third parties to access and record certain user-related and activity data and to track your interactions with this website. These tools and the informationcollected are used to operate and secure this website, enhance performance, enable certain website features and functionality, analyze and improve website performance, and personalize user experience.
If you click “Accept All”, you allow the deployment of all these tools and collection of the information by us and the third parties for all these purposes.
If you click “Decline All” your IP address and other information may still be collected but only by tools (including third party tools) that are necessary to operate, secure and enable default website features and functionalities. Review and change your preferences by clicking the “Configurations” at any time.
Visit our Privacy Policy