Parameters and inputs

fonctionnel

Typed notebook parameters with real inputs, presets, saved sets, query-filled and linked choices, Apply before re-running, and sensitive values kept private.

Typed notebook parameters: a country typed into a parameter cell waits behind the Apply bar, Apply re-runs only the cells that use it, and a City list is read from the database for the chosen country.

Real recording · typing sped up · Northwind demo data

Open the walkthrough on its own page

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

  1. Open the left rail's Paramètres page and press Add parameter, or add a Parameter cell from the add-cell row and choose New parameter….
  2. In the editor, give it a Nom (comme region), an optional Étiquette shown above the input, and a Type.
  3. Set a Valeur par défaut. Dates also take a phrase such as "last week", or Or a rolling default: a preset like Previous month that moves with the calendar.
  4. Optionally set where the choices come from, validation and behaviour (all below), then Enregistrer.
  5. Use it in SQL as :region, @region ou {{param.region}}, and in Markdown as {{param.region}}.
SQLly
Notebook parameter definition editorNotebook parameter definition editor
The parameter editor: name, label, type, default, allowed values, validation, sensitivity, sharing, scope, Apply and presets.

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 et {{param.old}} in every cell that uses it.

SQLly
Notebook Parameters rail with inputs and saved setsNotebook Parameters rail with inputs and saved sets
The Parameters page of the left rail: the parameter inputs, Add parameter, Saved sets and the Re-run on change switch.

Types and their inputs

TypeInputNotes
TexteA text boxMasked when the parameter is sensitive.
RechercherA search box with suggestionsSuggestions from a list or a query.
Whole number, Decimal numberA number field with a stepperKept within the validation minimum and maximum. Decimals are exact.
Yes or noA switchWritten the way each engine spells true and false.
Date, Date and timeA date picker; date and time shows its time zoneTime zones as offsets, or zone names on PostgreSQL, DuckDB, Oracle and ClickHouse.
Date rangeA date-range pickerStart and end are both included. Use {{param.period.start}}, .end, ou .end_exclusive (the day after the end) for < comparisons.
Dropdown, Multiple choiceA 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), et (NULL) when nothing is picked so IN still works.
LookupA search box and a list of matchesFor picking one record, such as a customer, from a query.
SliderA slider with its valueSet the minimum, maximum and step.
Table or column nameA dropdown of allowed namesOnly names on the allowed list can be chosen, quoted for the engine.
SecretA picker of secrets by name, with Add secret…The value is kept in your system keychain and never shown. See below.
SQLly
Text, search, number and switch parameter inputsText, search, number and switch parameter inputs
Text and number parameters: a text box, a search box with suggestions, a whole-number field with its range, a decimal field and a yes/no switch.
SQLly
Date, date-time and date-range parameter inputsDate, date-time and date-range parameter inputs
Date parameters: a date picker, a date-and-time picker with its time zone, and a date-range picker, with a Markdown cell showing the chosen values.
SQLly
Dropdown, multiple-choice, lookup and column-name parameter inputsDropdown, multiple-choice, lookup and column-name parameter inputs
Choice parameters: a dropdown, a multiple-choice list, a customer lookup filled by a read-only query, and an allow-listed column name.
SQLly
Slider and secret parameter inputsSlider and secret parameter inputs
A slider parameter with its value, and a secret parameter that picks a keychain-held secret by name and never shows it.

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

Sous 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.
SQLly
Parameter dropdown filled by a read-only queryParameter dropdown filled by a read-only query
A dropdown whose options come from a read-only query (cities of the chosen country), open, with the reload button in its header.

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.

SQLly
City dropdown re-read after the country parameter changedCity dropdown re-read after the country parameter changed
Linked parameters: after choosing France as the country, the City dropdown is read again and lists French cities.

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.

SQLly
Parameter Presets menu with date presets and saved setsParameter Presets menu with date presets and saved sets
The Presets menu of a date-range parameter: date presets, the notebook's saved sets, and saving the current values as a set.

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 Appliquer bar ("Database cells waiting for Apply: 3"), which lists each with its connection and environment badge, Production included. Appliquer runs them in notebook order; Ignorer 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.

SQLly
Apply bar listing cells waiting to re-run with Dev and Production badgesApply bar listing cells waiting to re-run with Dev and Production badges
The Apply bar after a parameter change: database cells waiting to re-run, each with its connection and environment.

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 Changer), 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.
SQLly
Masked sensitive parameter inputMasked sensitive parameter input
A sensitive parameter: the input stays masked and the Markdown cell shows dots instead of the value.

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 Tableaux de bord.
  • sqlly-cli notebook run --param name=value ou --param-set values.json sets 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.

Limites

  • 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.