Skip to main content
A segment is a saved filter that gives you a dedicated tab on a collection, showing only the records that match specific conditions. For code-based segments, see Code-based segments.

Create a segment

  1. Enable Layout Editor mode (top right of your screen)
  2. Click the ⚙️ cog icon next to the collection you want to edit
  3. Go to the Segments tab
  4. Click “Create your first segment” (or ”+ New segment” if you already have some)
  5. Give your segment a name
  6. Add one or more filters
  7. Optionally adjust the sort field and order
  8. Save
Newly created segments are disabled by default. Enable them from the Segments tab in Layout Editor mode.

Reorder segments

Use the Layout Editor to drag and drop segments into the order that matches your workflow.

SQL Query segments

For advanced filtering, create a segment using a raw SQL query.
To enable SQL Query segments in back-end v2, your developers need to add a connection name to the datasources on which you want to run live queries.
SQL Query mode is only available for SQL databases. For security reasons, only SELECT queries are allowed.
Switch to Query mode, type your SQL query, and save. The query must return the primary key column of the collection.
SELECT t.id FROM transactions t
JOIN companies beneficiary ON t.beneficiary_company_id = beneficiary.id
JOIN companies emitter ON t.emitter_company_id = emitter.id
WHERE beneficiary.headquarter ILIKE '%United States%'
  AND emitter.headquarter ILIKE '%United States%'
To query across multiple databases in PostgreSQL, you can use the dblink function.