Skip to content

Practical guide

Make page filters shareable with URL parameters

Read filter values from a Twidget page URL, validate them before querying data and preserve a useful shareable state without putting private data in links.

1. Choose which filters belong in the URL

Use this pattern for a link such as /tasks?status=open&page=1 that restores a list view. Keep simple, non-sensitive choices in the URL: an allowed status, sort key and bounded page position. Avoid tokens, customer details, private free-text searches and fields that should not enter browser history or referrer logs.

You need a page with a working paginated table and an endpoint whose permitted filters are explicit. This guide manages page navigation state; it does not replace the backend filtering rules.

2. Read and normalize the query values

Use the page query context, such as $query.status, through the value selector or page function. The documented text binding can display a query value, but request inputs remain untrusted even when they came from a link your app generated.

Define defaults and allowlists. Accept only known status and sort values, parse a page number deliberately, and bound its range. Decide how to handle absent, empty, repeated and malformed parameters. A text value of zero is not automatically a usable first page. Watch query parameters in Pages for where the context appears.

Page function inputs showing Page, Path, Query, Event and Form contexts
Existing Marketing page-function inputs expose Page, Path, Query, Event and Form contexts. This is the mapping interface, not the new request wiring.

3. Load the view through the bounded endpoint

Initialize page state from the normalized values, then call the list endpoint with its actual input names. Connect those values to query conditions explicitly. Adding a query parameter does not automatically change the database query or a table's local data.

Keep owner, organization and authorization checks inside the backend. A URL parameter such as owner_id must not replace verified identity. Return only the fields the table needs. If a filter produces no matches, show a successful empty view rather than resetting silently to a broader dataset.

Get Multiple Data INPUTS tab with Tasks selected and Add Query button
Earlier Marketing Get Multiple Data input controls. Configure the scoped record query for this guide separately; this image is not its completed read.
Existing Marketing auth/me endpoint with Bearer Token authentication
Existing Marketing identity endpoint with Bearer Token selected. Authentication identifies the caller; each record/action still needs authorization.

5. Handle reload, Back and invalid links

The URL and visible controls should agree after refresh and Back/Forward navigation. Reinitialize a changed view using the same normalization function rather than allowing two different sets of defaults. Guard against late responses from the previous filter.

A record-detail return link may retain the validated filter so the visitor can resume their work. For off-site return destinations, use a strict allowed-destination policy; a user-supplied URL must not become an open redirect. Do not assume private filtered views should be indexed as separate public marketing pages.

Go deeper

Supporting documentation

Find the configuration details and reference material behind this page.

From idea to a working flow

Build one useful thing with Twidget

Start with a small workflow, test it with sample data and make it your own.

Preview

Have any questions? Get in Touch

Starting with Twidget is easy, fast and free

It only takes a few clicks to get started

Get started - it's free

No credit card required.


© Copyright 2026 - Twidget.io