Filtering & Personalization
Set dashboard filters from the token
Lock a dashboard filter to a value your backend puts in the guest token, so viewers cannot change it. See the values you can pass and how names match.
Do this with your agent
embed-dashboardHelp me with this Databrain task: Set dashboard filters from the token. Check the current dashboard, host app and guest token scope where relevant. Show the planned changes and how to verify them. Ask before applying changes.
A dashboard app filter takes its value from params.dashboardAppFilters in the guest token. Viewers cannot change it.
Before you start
- You have a dashboard that a data app shares.
- Your backend creates guest tokens. See Guest token API.
Steps
Follow the written steps if you prefer text.
-
Open the dashboard and select Add filter, then Select.

Add filter is in the filter bar under the dashboard name. -
In Step 1 of 2: Filter values, enter a Filter Name, for example
region. This name is the key in the token.
The filter name is the key you send in the token. -
Pick the Filter Variant, for example Multi-Select. In Values from, choose the Dataset and the column that hold the values, then select Next.

The dataset and column give the filter its list of values. -
In Step 2 of 2: Apply filter, keep Target on Apply on and choose the columns.

Apply on adds the filter to every metric that reads this column. -
Turn on App Filter, then select Save. The filter shows in the filter bar of the dashboard.

App Filter makes the token the only source of the value. -
Copy the dashboard ID: the Key of the dashboard embed on the data app’s Embeds tab. See Dashboard ID.

Use the Key of the dashboard embed as dashboardId. -
In your backend, add the filter to
params.dashboardAppFilterswhen you create the guest token:
{
"clientId": "acme-corp",
"dataAppName": "Customer Analytics",
"params": {
"dashboardAppFilters": [
{
"dashboardId": "YOUR_DASHBOARD_ID",
"values": {
"region": ["Europe", "Asia Pacific"],
"order date": { "startDate": "2026-01-01", "endDate": "2026-03-31" },
"price": { "min": 100, "max": 900 }
},
"isShowOnUrl": false
}
]
}
}The dashboard opens with these filter values for the life of the token.

Values you can pass
| Filter type | Value |
|---|---|
| Single select | One string, number or boolean, for example "USA" |
| Multi select | An array, for example ["USA", "Canada"] |
| Date picker | { "startDate": "2026-01-01", "endDate": "2026-03-31" } |
| Preset date filter | The preset label, for example "Last 7 days". It must be one of the filter’s presets. |
| Number range | { "min": 100, "max": 900 } |
| Values from SQL | An object with sql and columnName (see below) |
Values from a SQL query
Use a SQL query when the list is long. Databrain runs the query and uses the values in columnName.
"values": {
"country": {
"sql": "SELECT \"name\" FROM \"public\".\"countries\" WHERE is_enabled = true",
"columnName": "name"
}
}The query must be one SELECT (or WITH) statement. On table tenancy, client_id_variable in the query becomes the token’s clientId.
If the SQL query fails or returns no rows, the dashboard loads without that filter by default. Ask Databrain to turn on “Stop the chart when a customer filter breaks” for your company if the filter guards data.
How the name is matched
The key matches the filter’s label or name, and case does not count. Country and country find the same filter.
Show or hide the value in the address bar
isShowOnUrl only matters when the dashboard writes filters to the page URL (options with "isModifyUrl": true). Leave it out or set false to keep token values out of the URL. Set true to show them.
Defaults from the component
global-filter-options on <dbn-dashboard> sets a default value. Viewers can change a default. Use the token when the value must not change. See Filter state.
If something goes wrong
The cards say “Not set up for your account”. Every app filter on the dashboard needs a value in the token. If the token leaves one out, each card refuses to load with the error code METRIC_OUT_OF_SCOPE. Add the filter to params.dashboardAppFilters, or turn off App Filter.
View underlying data is refused for one chart. The token gives a value for an app filter that the server cannot put on that chart’s rows: neither the metric nor the dashboard has that filter on a table the chart reads. The answer is HTTP 403 with code METRIC_OUT_OF_SCOPE, details.reason APP_FILTER_NOT_APPLIED and the filter names in details.missingAppFilters. The message says “Underlying data for this chart cannot be limited by the app filter ...”. Add the filter as an app filter on the metric, or on the dashboard’s filters, on a table the metric reads. Plugins older than 0.17 show only No Data Available for this refusal.
A text search filter is refused in the token. An app filter with a text search operator, such as Like or Not like, takes one nonempty string, or a list with exactly one nonempty string. A longer list is refused: App filter "<name>" has a wrong value: a text search filter takes one nonempty string.
The token request fails with HTTP 400 and code APP_FILTER_PARAM_ERROR. The message tells you why:
Invalid dashboard Id: <id> in dashboard appFilter. The dashboard ID is wrong, or the dashboard is not in this data app. Use the ID from the Embeds page, not the name.No filter found: <id> in dashboard appFilter. The dashboard has no filters yet.Invalid dashboard app filter name: <name>. No filter has this label or name, or App Filter is off for it.Invalid select query in dashboard app filter: <name>. The SQL in the value is not one validSELECTstatement.Invalid preset date option in dashboard app filter: <name>. The label is not one of the filter’s presets.
Next, see every token field.