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.

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
In the form builder, open the More form builder actions (three-dot) menu and choose Code editor.
This holds the JSON for every dataset your form uses.
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' } ] })" }
]
}
}
}
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
})
| Parameter | Type | What it does | Default |
|---|---|---|---|
search | Array of strings | Path(s) into nested data, filtering only within those paths. | [] |
matches | Array of objects | The 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" |
include | Array of strings | Keep only these fields in the results. | none |
exclude | Array of strings | Drop these fields from the results. | none |
Match conditions
Each object in matches describes one condition:
| Key | What it does |
|---|---|
fields | The field name(s) to match against. Multiple names form a path, for example an admin’s email is ["admin", "email"]. |
value | The 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"). |
operator | How 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
valueto 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
valueto 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.