Skip to main content
Written by RTILA Team - Senior Automation Engineer

Hardcoding every URL, search term, and selector makes automation brittle. Variables let you reuse one project across different inputs and environments.

Project Variables

Define reusable values once at the top of a project. Variables can be strings, numbers, booleans, or arrays.

{
  "name": "Parameterized_Scraper",
  "settings": {},
  "datasets": {},
  "commands": []
}

In practice, project variables are configured in the project settings or in a separate variable panel. Use ${variable_name} whenever you need the value inside a command parameter.

Global Variables

Global variables persist across different project runs and can store cookies, tokens, or last-seen values. A global variable search scenario on the learning site demonstrates how to extract a keyword, store it in a global variable, and reuse it on a later page.

CLI Variables

When launching RTILA X from the command line or through a scheduled task, you can pass variables from outside the project. This is useful for date ranges, search keywords, and environment-specific credentials.

rtila run project.json --var-search=smartphone

The engine uses the --var-<name>=<value> format. The older --var "search=smartphone" form is not recognized.

Substitution Syntax

Commands use ${var} syntax. Triggers use {var} syntax. The two are never interchangeable.

{
  "command": "goto",
  "params": {
    "url": "${base_url}/products/${category}"
  }
}

List Variables

A variable may hold a list of extracted URLs, product names, or IDs. for_each loops over list variables naturally by setting source_type to "variable" and providing the list variable name in variable.

{
  "command": "for_each",
  "params": {
    "source_type": "variable",
    "variable": "urls_to_visit",
    "as": "url",
    "do": []
  }
}

Type Preservation

Keep values in their original type as long as possible. Extracted text is often a string, but numeric transformations can cast it to number or boolean when needed. Preserve leading zeros or international formats by choosing the correct transformation instead of manipulating raw text manually.

Variable Meta Tags

Advanced projects can include meta tags that describe variable usage, default values, or UI hints. These meta tags are especially useful when the same project is shared by multiple team members.

Try It Yourself

Run the five Variables scenarios. They cover basic substitution, global variable search, list iteration, numeric type preservation, and parameterized keyword input.

Was this helpful?

โ† Back to Learning Hub