Parameters and inputs
functionalTyped notebook parameters with real inputs, presets, saved sets, query-filled and linked choices, Apply before re-running, and sensitive values kept private.
A notebook parameter is a named value, such as a region, a date range or a customer, that cells use instead of a hard-coded literal. Each one gets the input that fits its type: a date picker, a dropdown, a slider. Change it and only the cells that use it are marked out of date. SQLly writes the value into each database's SQL as a proper literal, so a parameter is never a way to inject SQL.
Add a parameter
- Open the left rail's Parameters page and press Add parameter, or add a Parameter cell from the add-cell row and choose New parameter….
- In the editor, give it a Name (such as
region), an optional Label shown above the input, and a Type. - Set a Default value. Dates also take a phrase such as "last week", or Or a rolling default: a preset like Previous month that moves with the calendar.
- Optionally set where the choices come from, validation and behaviour (all below), then Save.
- Use it in SQL as
:region,@regionor{{param.region}}, and in Markdown as{{param.region}}.


The Parameters page shows every parameter's input; a Parameter cell shows one of them between other cells, which is handy at the top of a report. Both are the same parameter, so changing it in either place changes it everywhere. Edit parameter next to an input reopens the editor, and Delete parameter is at its bottom. Renaming a parameter rewrites :old, @old and {{param.old}} in every cell that uses it.


Types and their inputs
| Type | Input | Notes |
|---|---|---|
| Text | A text box | Masked when the parameter is sensitive. |
| Search | A search box with suggestions | Suggestions from a list or a query. |
| Whole number, Decimal number | A number field with a stepper | Kept within the validation minimum and maximum. Decimals are exact. |
| Yes or no | A switch | Written the way each engine spells true and false. |
| Date, Date and time | A date picker; date and time shows its time zone | Time zones as offsets, or zone names on PostgreSQL, DuckDB, Oracle and ClickHouse. |
| Date range | A date-range picker | Start and end are both included. Use {{param.period.start}}, .end, or .end_exclusive (the day after the end) for < comparisons. |
| Dropdown, Multiple choice | A dropdown, or a checkbox list (with a filter when there are more than 12 choices) | A multiple choice is written as a list, (a, b), and (NULL) when nothing is picked so IN still works. |
| Lookup | A search box and a list of matches | For picking one record, such as a customer, from a query. |
| Slider | A slider with its value | Set the minimum, maximum and step. |
| Table or column name | A dropdown of allowed names | Only names on the allowed list can be chosen, quoted for the engine. |
| Secret | A picker of secrets by name, with Add secret… | The value is kept in your system keychain and never shown. See below. |








Typing waits for a short pause before the value changes, so cells aren't marked out of date on every keystroke. A value that doesn't fit is explained right under the input (out of range, not allowed, too long, required), and a cell that uses an invalid value is blocked with the reason rather than run.
How values reach the SQL
Only declared parameters are replaced, and only in live code: anything inside strings, comments and quoted names is left alone, as are @@ROWCOUNT-style names and :: casts. Values are written as literals for the cell's engine: N'…' strings on SQL Server, E'…' escapes on PostgreSQL, CAST('20261101' AS date) on SQL Server and DATE '2026-11-01' elsewhere, toDate(…) on ClickHouse, negative numbers in parentheses.
SELECT ShipCountry, SUM(Freight) AS Freight
FROM dbo.Orders
WHERE OrderDate >= {{param.period.start}}
AND OrderDate < {{param.period.end_exclusive}}
AND ShipCountry IN :countries
GROUP BY ShipCountry
On SQL Server, a script that DECLAREs a variable with the same name as a parameter still gets the parameter's value written in. Give them different names.
Choices from a list or a query
Under Choices come from, a dropdown, multiple choice, search or lookup takes its options from:
- A fixed list:
EU, US, APAC, or with labels,1=Gold, 2=Silver. - A read-only query on one of the notebook's connections (Runs on), such as
SELECT code, name FROM regions ORDER BY name, with a value column, a label column and a row limit (1,000 by default, 10,000 at most). The query must be a single SELECT; it runs on a read-only copy of the connection, and stops at the limit with "Showing the first 1,000 options; narrow the query to see the rest." Answers are cached; Reload options reads them again. In a lookup,{{search}}in the query filters by what you type.


Options queries wait until the notebook is trusted and its connection is allowed ("Options load once you trust this notebook."). A query that would read the parameter it fills is refused.
Linked parameters
An options query can use another parameter: SELECT DISTINCT ShipCity FROM dbo.Orders WHERE ShipCountry = {{param.country}}. When country changes, the city list is read again, and a city that is no longer offered is cleared (a multiple choice keeps the picks that are still there), which in turn marks the cells that use it out of date.


Presets and saved sets
Every input has a Presets menu. Date and date-range parameters offer Today, Yesterday, Last 7, 30 and 90 days, Week, Month, Quarter and Year to date, Previous week, month, quarter and year, and Current quarter (choose which under Presets offered); picking one keeps the parameter rolling, so "Previous month" is always last month. Named presets give any parameter labelled values: Europe = EU; Americas = US.
Save current values as a shared set… stores every parameter's current value under a name in the notebook, for everyone; Save current values as my set… keeps it on your computer only. Pick a set from the menu (or the rail's Saved sets) to apply all its values in one step.


Re-run on change and Apply
By default, changing a parameter only marks the cells that use it out of date; you decide when to run them. Switch on Re-run on change on the Parameters page and a change re-runs the affected cells for you, without flooding a database:
- Cells that compute in the notebook (charts, tables, formulas, transforms, cells on local data) re-run straight away.
- Cells that query a database wait in the Apply bar ("Database cells waiting for Apply: 3"), which lists each with its connection and environment badge, Production included. Apply runs them in notebook order; Discard drops the change.
A parameter set to Wait for Apply before cells use a new value holds your edit as a draft, shown as "Waiting for Apply" under its input, until you press Apply, so you can change three filters and run once.


Sensitive, personal and secret values
- Sensitive
- "Masked on screen and kept out of history, exports and links." The input is masked (other types show dots with Change), Markdown shows dots instead of the value, formula cells can't read it, and it is never saved in the notebook file, your personal file, saved sets, run history, query history or the activity panel. That holds for every kind of cell, including local cells and cells that read a formula's value: history keeps the SQL with the parameter as written, not its value. SQL hashes in run records, exports and the audit log are taken over the SQL with sensitive values left out, so a hash can't be used to guess one. The database still receives the value when a cell runs.
- Personal
- "Each person keeps their own value outside the notebook file." Your value, and your personal sets, live in
SQLLY/notebooks/personal/on your computer, so sharing the notebook doesn't share your picks. Other parameters' values are saved as the default in the file. - Can appear in shareable links
- Off keeps the value out of shared copies.
- Secret
- Picks a secret stored in your system keychain by name; Add secret… stores a new one. The value is never shown or saved in the file. SQLly can't yet pass a value to the database separately from the SQL, so a cell that uses a secret is refused rather than writing the secret into the query text.


Sensitive and secret parameters never keep a default in the notebook file.
Parameters on dashboards and in the CLI
- A dashboard's filter bar is bound to the parameters you pick and uses the same typed inputs as the Parameters page, in a compact form; a value waiting for Apply shows as waiting in both places. See Dashboards.
sqlly-cli notebook run --param name=valueor--param-set values.jsonsets them for a headless run; see the CLI.- Run history records the values each run used, with sensitive ones hidden; run comparison says when a parameter change explains a different result.
Limits
- Secret parameters can't be used in SQL yet (see above), and secrets can only be stored in the desktop app.
- Pattern (regular expression) validation isn't available.
- Options from another cell's result are empty until that cell has run.
- There are no palette commands for Apply or Add parameter yet.