Filter datasets

Dataset filtering lets you dynamically narrow the data a form pulls from a dataset, using the filterDataset() expression. It shows users only the data that is relevant to them, hides sensitive values, and keeps forms fast by pulling less from the server.

Filter datasets

This is an advanced, code-based feature. It is configured in the Code editor, there is no visual filter builder. If you are new to datasets, start with Use datasets first.

Why filter a dataset

Filtering a dataset helps you:

  • Focus the data on what is relevant to the current user or submission.
  • Hide sensitive values when they should not be exposed (SSNs, dates of birth, and the like).
  • Improve performance by pulling less data from the server.

Where filters are configured

1
Open the code editor

In the form builder, open the More form builder actions (three-dot) menu and choose Code editor.

2
Go to the Datasets tab

This holds the JSON for every dataset your form uses.

3
Add a filters array to the dataset

Under the dataset you want to filter (in global), add a filters array. Each entry targets one or more workflow steps and supplies a filterDataset() expression.

Filters are stored on each dataset under a filters array. Every entry has a steps list (the workflow steps it applies to) and a filter (a filterDataset() expression, or "all" to skip the dataset entirely on those steps). Here is a dataset block with filtering set up:

{
  "global": {
    "staff": {
      "datasetId": "Yrobox",
      "filters": [
        { "steps": ["step1"], "filter": "filterDataset({ matches: [ { fields: ['school_id'], value: 'school_a' } ] })" },
        { "steps": ["start"], "filter": "all" }
      ]
    },
    "school": {
      "datasetId": "4DKbpM",
      "filters": [
        { "steps": ["start", "step1"], "filter": "filterDataset({ matches: [ { fields: ['school_type'], value: 'High School' } ] })" }
      ]
    }
  }
}
The datasetId values are specific to your datasets, you can copy them from the Datasets page.

The filterDataset() syntax

filterDataset({
  search: [path1, path2],   // optional: only filter within these nested paths
  matches: [                // optional: one or more conditions
    {
      fields: ["fieldName"], // field(s) to match; multiple = a path, e.g. ["admin","email"]
      value: "valueToMatch", // a static value, a form field ID, or a user attribute
      operator: "eq"         // optional, default "eq"
    }
  ],
  matchType: "all",         // optional: "all" (AND) or "any" (OR); default "all"
  include: ["field1"],      // optional: keep only these fields in the result
  exclude: ["field2"]       // optional: drop these fields from the result
})
ParameterTypeWhat it doesDefault
searchArray of stringsPath(s) into nested data, filtering only within those paths.[]
matchesArray of objectsThe filter conditions (see below). Each specifies fields, a value, and an optional operator.[]
matchType"all" / "any"Whether all (AND) or any (OR) of the conditions must match. Only applies with multiple matches."all"
includeArray of stringsKeep only these fields in the results.none
excludeArray of stringsDrop these fields from the results.none

Match conditions

Each object in matches describes one condition:

KeyWhat it does
fieldsThe field name(s) to match against. Multiple names form a path, for example an admin’s email is ["admin", "email"].
valueThe value to match. It can be a static value, the ID of a field on the form, or a user attribute. Pass an array to match any of several values (the array is treated as "any").
operatorHow to compare (defaults to eq, an exact match).

Skip a dataset on a step

Set a step’s filter to "all" to exclude that dataset on those steps, so it is not loaded there at all. This is useful for performance when a step does not need the data. In the example above, the staff dataset is skipped at the start step and only filtered in at step1.

Tips

  • Match against form input. Set value to a field’s ID so the dataset filters live as the user fills out the form, for example showing only schools of the type they picked.
  • Match against the user. Use a user attribute as the value to scope data to the person filling out the form.
  • Test it. Use Preview and the workflow tester to confirm the right rows show at each step.

For everything else about datasets, see Use datasets; for writing expressions in general, see Use formulas and computed fields.

Need a hand setting up a filter? Contact the Droplet support team and share your dataset and what you are trying to narrow down.
Last reviewed by Nick Duell and published on June 22, 2026 4PM ET