Parameters and dynamic expressions in pipelines and notebooks

By Hatnest · Reviewed by Saurav Raj Joshi · Updated Nov 30, 2026

Hard-coded names and dates make a pipeline one-use. Parameters and expressions let one pipeline serve many tables, environments and days. This article covers how values are defined, passed in, computed and passed on.

Parameters, variables and library values

  • Pipeline parameters are inputs fixed for the whole run. You define them on the pipeline canvas background, in the Parameters tab: a name, a type and a default value. Callers (a schedule, a trigger, another pipeline) supply the actual value.
  • Pipeline variables are working storage that changes during a run. The Set variable activity writes a variable of type string, Boolean or array, and it can also set a pipeline return value for a caller. Append variable adds to an array variable.
  • Variable library is a workspace item that stores named values with alternative value sets (for example Dev, Test, Prod). The active value set decides what pipelines, notebooks and shortcuts read, which makes it the clean way to change a setting per stage without editing items.

Rule of thumb: parameter for something chosen before the run, variable for something learned during it, library for something that differs per environment.

How expressions work

Any field that offers Add dynamic content accepts an expression. An expression starts with @. The editor lists parameters, system variables, functions and variables for you.

  • A plain string is literal. To start a literal string with an at-sign, double it: @@.
  • @pipeline().parameters.myNumber returns a number as a number. Wrapped in interpolation, @{pipeline().parameters.myNumber}, the result is always a string. Interpolation lets you embed values inside text, as in "Run for @{pipeline().parameters.region}".
  • Use @concat(), @formatDateTime(), @utcnow() and similar functions for names built at run time.
  • Read an earlier activity's result with @activity('Name').output, drilling into fields with dots. If a pipeline parameter selects the field, use square brackets for it.
  • Inside a ForEach, @item() is the current element. @range(0,10) builds a sequence to loop over.
  • System variables include @pipeline().RunId, @pipeline().TriggerTime and @pipeline().TriggerName.
  • A single quote inside a string is escaped by doubling it.

A dynamic file name is a typical use:

@concat('sales_', formatDateTime(utcnow(), 'yyyyMMdd'), '.parquet')

Even connections can be parameterized: copy the connection ID (a GUID) from Manage connections and gateways, store it in a string parameter and reference it.

A common loop pattern

  1. A Lookup or Get metadata activity returns a list of tables or files.
  2. A ForEach iterates over @activity('Lookup1').output.value, optionally in parallel with a batch count, or sequentially.
  3. Inside it, a Copy or Notebook activity uses @item() to pick the source and destination.

Parameters for notebooks

A notebook receives values through a parameter cell: a code cell holding default values, marked with the "Mark cell as parameters" command. When run from a pipeline's Notebook activity, the base parameters override those defaults. The same works when another notebook calls it with notebookutils.notebook.run(path, timeout, {"date": "2026-11-30"}) or lists it in a runMultiple DAG with args.

# parameter cell
date = "2024-01-01"
region = "US"

Names should start with a letter or underscore and use letters, digits and underscores only. The activity can read the parameter cell and fill in names, types and defaults for you. To return something, the notebook ends with notebookutils.notebook.exit(value), and the caller receives that value as a string.

Passing values onward

Schedules and triggers can pass parameter values (the names must match exactly). Event triggers expose trigger parameters such as the file name. Child pipelines receive values from the parent's Invoke pipeline activity, and a child can tell its parent apart with @pipeline()?.TriggeredByPipelineName, which is null otherwise.

Common mistakes

  • Using interpolation and then being surprised that a number became text.
  • Forgetting to mark the parameter cell, so the passed values never arrive.
  • Giving a schedule a parameter name that differs in case or spelling from the pipeline's.
  • Putting an exit call inside a try-catch.
  • Hard-coding environment values instead of using a variable library.

For the exam

  • Parameters are fixed per run; variables change during a run; variable libraries hold per-environment values.
  • Expressions start with @; interpolation @{...} always returns a string.
  • @item() inside ForEach, @activity('x').output for earlier results.
  • Notebooks need a parameter cell; base parameters override its defaults.
  • Notebook exit values come back to the caller as strings.

Sources