Unify Applications
Logo
Sort and Filter

Sort and Filter

Logo

5 mins READ

query-filter-sort.png
query-filter-sort.png

Overview

To let users sort and filter data on a page, use the Filters block. It is a toolbar of filter controls — a condition builder, a date range picker, one-click quick filters, per-field filters, a sort menu, a keyword search box and an AI prompt — that together publish one shared filter state. The block never queries data itself: you point it at one or more data sources so it knows which fields can be filtered and sorted, users compose criteria in the toolbar, and you bind the result into your data source's inputs. For a deeper guide to the same block, see Filters, Sorting & Pagination.

Drop a Filters block above the block it should control — typically a Table, a Repeatable or a Chart. A new Filters block starts with three controls: a condition-builder filter, a date filter preset to the last 30 days, and a search box. Select your data sources under Data Sources, add or remove controls under Standard Actions, then bind the block's state into your data source's filter, sort and search inputs. When a user changes anything in the toolbar, the query re-runs with the new values.

Note: The Table block has its own toolbar filter and sort controls. Use the Filters block when you need one toolbar that drives a non-table block, several blocks, or a combination of conditions, date range, sort and search feeding the same query.

Properties

Content Properties

Property

Default

Description

Data Sources

—

The data sources whose fields the toolbar offers for filtering and sorting. The block reads their field details only; it never runs them itself.

Standard Actions

Data filter, date filter, search

The controls in the toolbar. Each action has a type, a label and its own detail panel (see Action Types below).

Permissions

—

Restricts who sees the whole block. Each action also has its own permissions on its detail panel.

Interactions → Remember applied changes

Off

Keeps the user's filter criteria, sort order, search and date range when they leave and return to the page in the same browser tab.

Interactions → Events

—

Actions to run when the filter state changes (On Filter Change).

Action Types

Action (menu label)

What it adds

AI Filter

A prompt where the user describes the filter in plain language and the block applies it.

Quick Filter

A one-click chip that applies a pre-configured filter or date range.

Field Filter

A chip scoped to one field of the data source.

Filter

The full condition builder, with nested AND/OR groups.

Sort

A sort menu over the data source's sortable fields.

Date Filter

A date or date range picker with optional presets.

Keyword Search

A keyword search box.

Only one AI Filter, Filter, Sort, Date Filter and Keyword Search action is used per block — if you add two of the same type, the last one wins. You can add as many Quick Filter and Field Filter actions as you need.

Appearance Properties

Property

Description

Styles

Layout, padding, visibility, radius and rotation. Radius rounds each filter control, not the toolbar container.

Disabled

When true, every control in the toolbar is disabled.

Visibility

Show or hide the whole block.

Events

Event

Trigger

On Filter Change

A control in the toolbar changes the filter state, including initial values applied on page load. Changes made by the AI action or by the Reset and Set Value methods don't fire it.

Methods

Call these with the Trigger Component Method action.

Method

Params

Description

Reset

Filter, Sort, Search (default: all three)

Clears the chosen parts of the state. Resetting Filter also clears the date range, quick filter selections and field filters.

Set Value

Filter, Sort, Search, date range

Applies the given values. A value with the wrong shape is ignored without an error.

Exposed State

The block publishes what the user has applied under its id. Bind these to your data source's inputs. The state is empty until something is applied.

State

Type

Description

{{ filters1.state.filter }}

object

The combined filter conditions: the condition builder and every applied field filter.

{{ filters1.state.search }}

string

The search text.

{{ filters1.state.sort }}

array

Sort entries, each a field plus ASC or DESC.

{{ filters1.state.dateRangePreset }}

string

The active date preset (for example last30days); empty for a custom range.

{{ filters1.state.dateTimeFilter.epoch.startTime }} / .endTime

number

The selected date range in epoch milliseconds. previousStartTime / previousEndTime cover the same-length period just before it, for period-over-period comparisons. For ISO strings, use {{ filters1.state.dateTimeFilter.iso.startTime }} / .endTime.

{{ filters1.state.filterMenuState }}

object

The filter the user is still editing in the menu, before Apply. Useful for cascading filters.

Integration: Wiring to a Data Source

  1. Add the block: Drop a Filters block above your table and select the table's data source under Data Sources.

  2. Choose the controls: Keep the default Filter, Date Filter and Keyword Search actions, or add Sort, Quick Filter, Field Filter or AI Filter actions under Standard Actions.

  3. Bind the inputs: Open the data source's Input tab. On a fetch-records data source, bind Filter records to {{ filters1.state.filter }}, set Search records → Fields to the fields to search and bind its Value to {{ filters1.state.search }}, and use {{ filters1.state.sort }} for the sort. Bind your date inputs to {{ filters1.state.dateTimeFilter.epoch.startTime }} and {{ filters1.state.dateTimeFilter.epoch.endTime }}. Selecting a data source under Data Sources only lists its fields; nothing filters until these inputs are bound.

  4. Test it: Preview the page. The query re-runs whenever the user changes anything in the toolbar.

Use Cases

One-Click Status Views

Add three Quick Filter actions — "Open", "In progress", "Closed" — each with a filter on the status field. Mark "Open" as Apply by default so the page loads pre-filtered. Users switch views with one click.

Report Date Range

Use the Date action with presets on a dashboard and bind every chart's data source to the date range. Use the previous-period values to show change against the period before.

Keep Filters Across Navigation

Turn on Remember applied changes. A user who filters a list, opens a record and comes back still sees their filter, sort, search and date range for the rest of the tab session.

Tip: Add a "Clear filters" button that calls the Filters block's Reset method. With Remember applied changes on, a returning user's saved filters replace any configured initial values for that visit.

Page

Relationship

Filters, Sorting & Pagination

Covers the same Filters block in more depth

Column Groups & Custom Filter Fields

The Table's own toolbar filter state, read from {{ table1.filters.filter }} — a different path from this block's {{ filters1.state.filter }}

Toolbar & Views

Filter, search and sort controls built into the Table toolbar

FAQs

Where do filters and sorting get configured?

Configure them on the data source to limit what is fetched, or on a Table or List component in Filter and Sorts to let viewers explore the displayed data.

How does the condition builder work?

Build each condition from a field, operator, and value; combine conditions with AND or OR, and nest groups when needed.

How do I choose which fields users can filter and sort by?

In the table's Fields section, set the Field key, Display label, and Field type, then mark each field Filterable, Sortable, or both and choose its operators.