Data Set View Filters

Liferay DXP 2024.Q1 U112 Beta Feature

While managing data set views, 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.

Adding Filters to the Data Set View

  1. Open the Global Menu (Global Menu), select the Control Panel tab, and click Data Sets under Object.

  2. Click on the Name of the data set you want to access.

    Alternatively, click Actions (Actions menu) next to the data set entry and select Edit.

  3. Click on the Name of the data set view to start editing it.

  4. Select the Filters tab.

  5. Click Add (Add button) and choose one of the available options: Client Extension, Date Range, or Selection.

Selecting the Filter Field

Liferay DXP 2024.Q4+

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).

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.

You can see all fields for the chosen entry type, as well as related entry types.

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 view 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.

Client Extension Filter

Use a frontend data set filter client extension or deploy a client extension from your workspace to customize the filter experience and add new types of filters to your data set view.

You must have a Frontend Data Set Filter client extension to create the client extension filter.

  1. Choose Client Extension when adding a new filter.

    Each field can be associated with only one filter at a time.

  2. Fill in the Name of the filter and, optionally, localize it.

  3. Select the Field by which you want to filter the entries.

  4. Select the Frontend Data Set Filter client extension and click Save.

Create a filter based on a client extension.

Date Range Filter

Use date-type fields to pre-filter the displayed entries.

  1. Choose Date Range when adding a new filter.

  2. Fill in the Name of the filter and, optionally, localize it.

  3. Select the Field by which you want to filter the entries.

    Each field can be associated with only one filter at a time.

  4. (Optional) Set From and To dates to pre-filter the entries, and the filter shows entries within the specified range.

  5. Click Save.

Create a filter based on a date field.

Selection Filter

Use API REST endpoints or picklist options as parameters for the filter.

Start by choosing Selection when adding a new filter. The Selection filter has three sections: Configuration, Filter Source, and Filter Option.

Under Configuration,

  1. Fill in the Name of the filter and, optionally, localize it.

  2. Select the Field by which you want to filter the entries.

Under Filter Source,

  1. Configure the Filter Source to determine the values offered in the filter. Choose an Object Picklist or an Liferay DXP 2024.Q3+/Portal 7.4 GA125+ API REST Application to associate with the filter.

    • With Object Picklists, choose a picklist to associate with the filter.

      Selecting an API REST Application as the source.

    • Liferay DXP 2024.Q3+/Portal 7.4 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.

      Selecting an Object Picklist as the source.

Under Filter Options,

  1. Preselect values for the filter.

    If you choose the Single selection option, you can only preselect one value.

  2. Determine if users can select multiple or single values.

  3. Click Save.

Capabilities

Product

Contact Us

Connect

Powered by Liferay
© 2024 Liferay Inc. All Rights Reserved • Privacy Policy