Semaphor

Controls

Add dynamic viewer inputs to dashboards that change data or chart structure at runtime

Controls are dynamic inputs -- dropdowns, toggles, text fields, date pickers -- that dashboard authors define and viewers interact with. When a viewer changes a control value, affected cards re-query automatically.

Controls and Filters

Controls work alongside filters, not as a replacement. Filters narrow rows in the result set using {{ filters | where }} syntax. Controls are more general -- they let viewers control the logic flow of queries, switch which metric or dimension is displayed, change aggregation functions, or adjust time granularity. You can use both on the same dashboard.


Dashboard Controls vs Card Controls

Controls can be defined at two scopes:

ScopeWhere it appearsWho uses itBest for
DashboardDashboard toolbar, alongside filtersAll cards that reference itShared inputs like "Region" or "Time Grain" that affect many cards
CardCard header areaOnly the card it belongs toCard-specific toggles like "Show Estimated vs Actual" or a metric switcher local to one chart

Dashboard controls let multiple cards reference the same input. When a viewer selects a value, every card that references that control updates together.

Card controls are scoped to a single card. They appear in the card header and only affect that card's query or configuration.


Control Types

Controls fall into two categories: value controls that produce a literal value for use in SQL, and structural controls that modify a card's visual configuration.

Value Controls

Value controls produce a literal value that you can reference in SQL queries using the [[param.control_id]] placeholder syntax.

TypeInput WidgetValue Type
enumSingle-select dropdownstring
multi_enumMulti-select dropdown with checkboxesstring[]
textText inputstring
numberNumeric inputnumber
booleanToggle switchboolean
dateDate pickerISO date string

See SQL Controls for placeholder syntax and examples.

Structural Controls

Structural controls modify a card's visual configuration rather than substituting values in SQL. They work with cards built using the visual explorer (drag-and-drop mode).

TypeWhat it changes
field_selectorSwaps the dimension or grouping field
metric_selectorSwaps which metric is displayed
aggregation_selectorChanges the aggregation function (SUM, AVG, COUNT, MIN, MAX, MEDIAN, DISTINCT)
grain_selectorChanges the time granularity (day, week, month, quarter, year, hour, minute, second)

See Structural Controls for configuration details.


Where Options Come From

Each control needs a set of options for the viewer to choose from. Semaphor supports several sources depending on the control type:

SourceDescriptionUsed by
Manual listAuthor defines a fixed set of options with labels and valuesenum, multi_enum
Dataset valuesOptions loaded dynamically from distinct values of a field in the connected databaseenum, multi_enum
Field allowlistA set of dimension fields the viewer can choose fromfield_selector
Metric allowlistA set of metrics the viewer can choose frommetric_selector

For aggregation_selector and grain_selector, the available options come from the built-in list of supported aggregations and time grains.


Control Properties

Every control supports a common set of properties that govern its behavior and visibility.

PropertyDescription
defaultValueThe initial value when the dashboard loads
requiredMust have a value before the query runs. If required and no value is set, the card shows an error state
hiddenControl exists and has a value but is not visible to viewers. Useful for programmatic or embed-only controls
lockedControl is visible but viewers cannot change its value. Useful for showing context without allowing edits
helpTextTooltip text shown to viewers on hover
placementWhere the control appears: toolbar (dashboard toolbar), card_header (card title area), or advanced (behind a "More options" button)

Getting Started

On this page