1. Docs
  2. Reference
  3. Step reference
  4. Data and variables

Data and variables

A variable carries a value from one step to another: an order number read from the page, a token from an API, a code from an email. This page explains how to save values, how to refer to them, and what happens when a reference cannot be resolved.

5 min read Updated CustomersAdmins

In short

On this page you can

  • Read a value saved earlier with {{tc:name}} in any step value.
  • Set fixed or combined values with the Global parameter step.
  • Clean a value read by Get with transforms such as Trim or To Number.
  • Use data source values with {{ds:name}} and Excel columns with {{excel:key}}_column.
  • Read a variable of another test case in the same pipeline with {{tc:caseId.name}}.

How to use it

  1. Add a step that produces a value: Get, an API JSON path, a Database output, a code step set to Value.
  2. Give the output a clear name, for example orderId.
  3. In a later step, type {{tc:orderId}} or pick it with the parameter picker icon.
  4. Add an Assertion on the variable when its value matters.
  5. Run a Dry Run and check the resolved value in the live log.

Pass a value from one step to another#

  1. Save the value

    Use a step that produces an output (see Steps that produce variables) and give the output a name such as orderId. Names may contain letters, digits and underscore.

  2. Refer to it

    In any later step value type {{tc:orderId}}, alone or inside text: Order {{tc:orderId}} is ready. The picker icon next to a value field lists data sources, global parameters and datasets, and inserts the reference for you.

  3. Run

    When the step runs, the reference is replaced by the value. The live log shows the resolved value.

    Example: Type step value {{tc:orderId}} → log "1042" was entered into the "Search" field.

Reference syntax#

WriteReadsExample
{{tc:name}}A variable saved by a step of this test case (or of a template inside it).{{tc:token}}
{{tc:caseId.name}}The variable of another test case that ran earlier in the same pipeline.{{tc:1484.customerId}}
{{ds:name}}A value from a data source of the project.{{ds:adminUser}}
{{excel:key}}_columnA column of the current row of an Excel dataset.{{excel:users}}_email
{{name}}The older form, without prefix. It reads a variable of this test case first. Only when no step produced it, and the reference is the whole value, it falls back to a data source key or dataset of that name. Inside longer text it reads only the run’s variables. Resolution order{{otp}}

Unresolved references stay as text

If no value is found, the reference is not replaced: a Type step types {{tc:orderId}} into the field. An Assertion treats it as empty and logs “{{tc:orderId}} not found, treated as empty”. Check the spelling and that the producing step ran before. See Troubleshooting.

Steps that produce variables#

StepHow you name the outputWhat it holds
Get (web)The parameter keyThe element’s text, or its value
Get Text, Get Attribute, Store Variable (mobile, desktop)The variable name in the stepText, an attribute, or a fixed value
Global parameterThe keyThe value you set (variables in it are resolved)
API RequestThe key of a JSON Paths rowA response field, @status or a header
DatabaseOutput Values, in column orderColumn values of the first row (or row N)
Extract OTP, Extract Link, Wait for MailOutput Variable, Subject Output, Content OutputThe code, the link, the subject, the body
NetworkSave to variable rowsStatus, body field, header, duration, call count…
Python, JavaScriptOutput set to Value, with a nameThe value the code returns
AI Ask, AI Check, AI ChatOutput Value = Value, Variable NameThe AI’s answer

The Global parameter step#

Sets one or more variables to values you choose, without touching the app. Use it for test data that several steps share, or to build a value from others ({{tc:firstName}}.{{tc:lastName}}@example.com). It exists in every project type.

  1. Open the dialog

    Click More › Global parameter (on wide screens the toolbar shows it as Param). The dialog Add Global Param Step opens.

  2. Fill it

    Test Step Name, then Key (the variable name) and Value. The picker icon inserts a data source, global parameter or dataset reference.

  3. Add more values

    Select the step and use Add Param in the right panel for more key and value pairs.

    The step shows the chip Param. When it runs, each value is resolved and saved; the log lists the keys and values.

If the key is already registered as a global parameter by another source, saving shows “This key is already registered as a global parameter, please change the key value.: key”. Pick another name.

Transforms on Get steps#

A Get step can clean the value it reads before saving it. Add a transform row in the right panel; transforms run in order, after the value is read. Transforms are offered only on Get steps.

TransformValueExample
TrimOptional characters 34 → 34; with *: *34* → 34
Trim BeforeA textUSD:34 with : → 34 (removes the text and what comes before it)
Trim Before BackA text34* with * → 34 (from the last match, removes it and what follows)
Upper Case / Lower CaseNoneok → OK
Replaceold=>new1.234 with .=> → 1234
To NumberNone€ 1.234,56 → 1234.56 (the last of . or , is the decimal mark)
To IntegerNone76.9 → 76
RoundNumber of decimals3.14159 with 2 → 3.14 (binary rounding: 76.945 becomes 76.94)
Default ValueA fallbackempty → N/A
Substringa:b2026-11-08 with 0:4 → 2026

A transform that cannot apply (no number found, no match) leaves the value unchanged; the step does not fail. The Timeout row sets how many seconds this Get step waits for its element (1–300).

How long a variable lives#

Didn’t find your answer?Write to support with your project name and what you see on screen.

info@smartestqa.ai
© 2026 Selenity Technology · SmartestQAsmartestqa.aiThis page as MarkdownChecked against smarttest-fe predev 2a8c79cc, smarttest-be 633c2a03, smarttest-testsuite 017fcec