User Guide
Other documentationsDemoCommunity
  • Forest Admin
  • Getting Started
    • Setup guide
    • Master your UI
      • The Table View
      • Using the Layout Editor mode
        • Customize the Table View
        • Customize the Details View
        • Customize your creation and edition forms
      • Build a Summary View
      • Build an Explorer View
      • Using Smart Views
    • Tutorials
  • Collections
    • Manage your collection settings
    • Customize your fields
      • Edit widgets
      • Display widgets
      • Options
      • Default actions on relationships
    • Actions
      • Edit a record
      • Create a record
      • Using Smart Actions
    • Segments
    • Scopes
    • Performance
  • Workspaces
    • Introduction to Workspaces
    • Using Workspaces
      • Sharing your own Workspace URL with pre-selected data
      • Editing records with field components
    • Building a workspace
      • Workspace Incident Management example
      • Workspace KYC example
      • Transactions Monitoring & Fraud Management example
      • Fleet Management example
  • dashboards
    • Charts
      • Create a chart
      • Display record-specific charts in Analytics
  • Other tabs
    • Collaboration
      • Communicate with Notes
      • Approval requests
      • Inboxes
    • Activity
  • Integrations
    • Metabase
  • Project settings
    • General tab
    • Environments tab
    • Teams, Users & Permissions
      • Create and manage a team
      • Add and manage users
      • Manage roles and permission levels
      • Export users history
    • Security tab
      • SCIM integration with OneLogin
      • SCIM integration with Okta
      • Manual SCIM integration with Okta
    • Other project settings
      • Interface tab
      • Billing tab
    • Organizations
      • Organization settings
        • Configure SSO with AWS IAM
        • Configure SSO with Azure AD
        • Configure SSO with Google
        • Configure SSO with Okta
        • Configure SSO with OneLogin
Powered by GitBook
On this page
  • What is a segment?
  • Create simple Segments
  • Create SQL Query Segments
  • Organize your workflows through with the layout editor ​

Was this helpful?

  1. Collections

Segments

PreviousUsing Smart ActionsNextScopes

Last updated 4 months ago

Was this helpful?

What is a segment?

A Segment is a subset of a collection gathering filtered records.

Segments are designed for those who want to systematically visualize data according to specific sets of filters. It allows you to save your filters configuration so you don’t have to compute the same actions every day (e.g. signup this week, pending transactions).

Forest Admin provides a straightforward UI to configure the segments you want step-by-step. The only information Forest Admin needs to create a segment within a collection is a name and some filters.

Create simple Segments

To create a new segment, activate the Layout Editor mode (1) on the top right part of your screen and click on the cog just next to the collection you want to edit (2) and select the Segments tab (3).

At this point there are 2 possibilities:

If you have never created any segment for this collection, click the "Create your first segment" (4).

Otherwise, click the "+ New segment" link (5).

Create SQL Query Segments

Forest Admin gives you a second option to create segment: SQL queries.

To enable this feature in agents v2, your developers have to add a connection name to the datasources on which you want to execute live queries segments.

After that, you must select on which one you want to run the query.

Query mode is only available for databases which support SQL. For security reasons, only SELECT queries are allowed.

SQL queries allow you to create advanced filters and connect your data through a few lines of code if you know how SQL queries work.

Simply switch to Query mode (1), type in your SQL query (2) and save.

QUERY
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%'

In agent v1, the returned column must be id. Whereas in agent v2, the returned column must be the primary key field.

In the above example, we display the transactions whose beneficiaries and emitters are in the United States.

If you want to make a SQL segment based on several databases, you can use the dblink function for postgreSQL.

Organize your workflows through with the layout editor ​

By default, newly created segments are disabled.

To create your segment, give it a name (6) and add 1 or more filter(s) (7). You can also adjust your sorting field and order .

Usually, you want the organization of your segments to match the sequencing of your business workflows. To do so, you can reorder your segments using the Layout Editor mode just .

like you would for collections
like you would for a collection