How to Apply Client-side Filters and Sort in XRL
Learn how to use client-side filters to enhance your HyperGrid XRL experience and narrow down the results.
Introduction
Client-side filters are a set of filters applied to the Related List view currently displayed in the lightning page of a record. These are real-time filters that can be applied to the columns currently visible in the Related List view. The filtered data persists only for the time the particular view is displayed on the page. Once, the user switches the view or logs out of the org, the filtered results disappear and Users get to see the view which was originally configured by them. Client-side filters can be used along with server-side filters and global search to narrow down the results and access the precise records in a highly efficient manner.
By the end of the article you will learn how to enable or disable the filtering option on a column for a Related List view, the criteria and data types corresponding to the columns, and applying column filters on multiple columns to get very particular data in the view.
In addition, you will also learn how to reset the client-side filters to return to the originally configured view and how to sort the data in each column to view records in specific sequence.
Limitations of Standard Salesforce filters
In Salesforce Related Lists, filtering is very restricted due to following reasons:
- Filters are applicable to only those fields which are configured to display in the Related List. This means, if a field is not visible in the Related List, user can't filter the data based on that field.
- Filtering of records can be done only after configuring the Related List when we use Related List Single. Thus the Related List contains lot of data which is not particularly useful for the user.
- Data filtering is not persistent, and filtered data is available only for the current session.
- In Dynamic Related List sever-side filtering is available to define a condition based on which data is fetched in the Related List view. But Dynamic Related List can be configured by only admin or admin-like users. Moreover, Dynamic Related Lists display only 30 records which is gives very limited data in case of heavy data sets and is not useful for end users.
Which type of user can use this functionality?
HyperGrid XRL Power users and standard users can both use client-side filters to filter the records. However, Power users have the right to enable/disable the client-side filter icon by accessing the Field Settings in the Configuration wizard.
Prerequisites Make sure that you log in to your Salesforce account, install, and configure HyperGrid XRL. Refer to the links below for more detailed instructions. |
.
Procedure
Let's take a look at the process to follow to apply client-side filters to the configured fields.
Column Filters
You can apply column filters to ensure that only particular records are displayed in the column according to the use case. It's also important to note that column-side filters are only available to those fields which are configured and visible.
We will work with Cases XRL to walk you through the steps to apply column-side filters using XRL.
Step 1: On the Cases XRL view, choose any particular column and click on the filter icon.
Step 2: Column Filter Criteria
The data operator is set to "Is equal" by default. The types of filters that can be used, such as text boxes, popup pickers, and drop-down lists, depend on the field type that each column is associated with. The different types of filtering criteria are as follows:
- Is equal: This filter displays the records with data that exactly matches the filter value
- Is not equal: This filter displays the records with data that does not exactly match the filter value
- Begins with: This filter displays the records with data that begins with the specified value
- Does not begin with: This filter displays the records with data that does not begin with the specified filter value
- Ends with: This filter displays the records with data that ends with the filter value
- Does not end with: This filter displays the records with data that does not end with the filter value
- Contains: This filter displays the records with data that contains the filter value
- Does not contain: This filter displays the records with data that does not contain the filter value
- Greater than: This filter displays the records with a value greater than the filter value
- Greater or equal: This filter displays the records with a value greater than or equal to the filter value
- Less than: This filter displays the records with a value lesser than the filter value
- Less or equal: This filter displays the records with a value less than or equal to the filter value
- Range: This filter displays the records with a value with a specified range
Step 3: Examples of Column Filters
Some examples of how column filters are applied to different data types are shown below.
Example 1: In the Created Date field, if you only want to view records created after 5th December 2022.
- Click on the filter icon
- Select your operator from the drop-down list. In the example, select “Greater Than”
- Use the calendar interface to select the date and time
- Click Save Filter.
Example 2: In this example, you want to filter records based on a particular case origin.
- In the Case Origin field, click on the filter icon.
- Select your operator from the drop-down list. In the example, select “Is Equal”
- Select the required case origin from the drop-down list.
- Click Save Filter. All the records which have the Email case origin are displayed.
Step 4: Reset Filters
Click on the Reset Filters icon to clear all the applied filters. Please note that this function will only apply to column filters. This will not be applied to server-side filters.
Step 5: Export Filters
Click on the Export icon to export a set of records to an Excel® or CSV file. Please note that only the filter records which are displayed in the view will be exported. To know more about exporting records, go through our article on Ad hoc export of Related List view.
Sorting Columns
HyperGrid allows users to sort records in real-time with Column-sorting. This feature sorts the record in ascending or descending order based on the values of a given column.
Prerequisites User needs to make sure that the desired column according to which sorting is done is “sortable”. To enable that go to Configure -→ Field Settings-→Choose Field--→ Tick on “Is Column Sortable” and save the setting. |
Step 1: To sort the records, go to the column header for which sorting needs to be done and is enabled as mentioned above. Click on the column order and an arrow will appear beside the column name.
Step 2: To sort by descending order, click the arrow once more inside the field header. To restore the default order, click once more, as shown in the snippet below.
Results
By applying client-side filters at appropriate columns and sorting the order of display of values within each column, a user can quickly spot the required information dynamically.
Complimented with server-side filters and global search, it empowers users with access to the right information at the right time.