Skip to main content
All CollectionsGetting Started
4. Mastering Variables & Parameters in RPA

4. Mastering Variables & Parameters in RPA

Unlock the full potential of automation with flexible and reusable data handling.

Sophie avatar
Written by Sophie
Updated over 3 weeks ago

Imagine a warehouse filled with labeled boxes: the contents inside each box may change, but the labels remain the same, ensuring everything stays organized. This is exactly how variables work in automation workflow—storing dynamic values under fixed names so they can be used and updated throughout a workflow.

Without variables, every time you need to update a value, you’d have to go through each step manually. Variables eliminate this hassle by allowing you to modify a single value in one place, which then updates everywhere it has been used. This makes your automation workflows more flexible, scalable, and easier to maintain.

There are three types of variables in Octoparse AI:

  • Custom Variables: User-defined values that can be manually created and assigned.

  • System Variables: Prebuilt values providing system and execution context.

  • Flow Variables: Automatically generated by commands during execution.


Understanding Variable Types

Custom Variables: Your Own Data Containers

Custom variables act as an interface for human input in an RPA workflow. These can be manually created when you edit the workflow, or assigned using the Set Variable command.

Octoparse AI supports six types of custom variables:

  • Text – Stores words, phrases, or any string data, like a username.

  • Number – Holds numeric values for calculations.

  • Boolean – Represents true/false conditions.

  • Data Table – Manages structured data like spreadsheets.

  • List – Contains an ordered collection of values.

  • Dictionary – Stores key-value pairs, useful for structured data retrieval.

Flow Variables: Capturing Real-Time Data

Flow variables are dynamically created by specific commands as the RPA app runs. These are temporary but crucial for passing data between steps.

💡 Example: Log in to Octoparse.ai

You don’t need to predefine flow variables—they appear when a command generates an output.

System Variables: Accessing Execution Context

System variables provide useful built-in information about your environment, making workflows more adaptable. These are automatically available and don’t need manual creation.

These variables automatically retrieve system-related information, such as file paths, execution details, and trigger data.

1. Date and Time

  • SystemVariable.CurrentTime → Retrieves the current date and time in yyyyMMddhhmmss format. Example: Use it to name exported files (Report_20250328.xlsx).

2. System Paths (Automatically detects the correct path based on the OS)

  • SystemVariable.DesktopFolder → Path to the current user's desktop.

  • SystemVariable.DownloadsFolder → Path to the default downloads folder.

  • SystemVariable.UserProfilesFolder → Path to the current user's home directory.

  • SystemVariable.DocumentsFolder → Path to the user's documents folder.

  • SystemVariable.PicturesFolder → Path to the user's pictures folder.

  • SystemVariable.RoamingFolder → Path to the app data folder (AppData\Roaming).

  • SystemVariable.TempFolder → Path to the system's temporary folder.

  • SystemVariable.SystemFolder → Path to the Windows system folder.

2. Application Execution Context

  • SystemVariable.AppName → Retrieves the name of the running Octoparse AI app.

  • SystemVariable.ExecutorName → Retrieves the name of the machine or RPA bot executing the process.

  • SystemVariable.UserName → Retrieves the username under which the process is running.

  1. Trigger Information (For event-driven automation)

  • SystemVariable.TriggerName → Retrieves the name of the trigger that started the process.

  • SystemVariable.StartTime → Retrieves the exact timestamp of when the trigger activated.


Startup Parameters: Customizing Workflows at Runtime

When Do You Need Startup Parameters?

Sometimes, you may want to input values before running an automation, rather than hardcoding them. This is where startup parameters come in. They allow users to enter information dynamically each time the workflow runs.

Common scenarios include:

  • Automating multiple account logins by prompting for a username and password at runtime.

  • Running a workflow with different input files without modifying the script.

  • Avoiding storing sensitive data (like passwords) inside the automation.

How to Use Startup Parameters?

  1. Enable Set as startup parameter when creating a variable.

  2. When you run the app from the client, a pop-up will appear for you to enter the values.

  3. If needed, check Remember content to save the last-used values.


How to Use Variables in Your Workflow

Once a variable is generated, using it in your workflow is simple. Think of variables as labeled boxes—you refer to them by their label (variable name), but what really matters is the content inside (variable value).

Whenever you see an input field that supports variables, look for the {x} button.

Clicking it will open a list of available variables, including custom, system, and flow variables. Select the variable name you need, and the automation will dynamically replace it with the actual value during execution.

Example:

  • You've set a variable userID = 12345

  • In an input field, you insert {userID}

  • At runtime, the system replaces {userID} with 12345 automatically

This way, you can build flexible workflows that adapt to different inputs without manual edits.


Real-World Examples

1. Automating File Naming with System Variables

Problem: Manually renaming reports with dates is tedious and prone to errors. Solution: Use SystemVariable.CurrentTime to automatically generate file names like Report_202403281234.xlsx.

2. Multi-User Login Automation

Problem: Running an automation for different users requires constant script changes. Solution: Use startup parameters (username, password) so the workflow asks for login details when it starts, instead of storing them in the script. This way, different users can run the same automation without modifying the workflow.

3. Web Scraping with Dynamic Data Handling

Problem: Need to extract product details and validate page content before storing data. Solution:

  • Use flow variables (productTitle, price) to process scraped data.

  • Use system variables (System.Browser.Title) to confirm the correct page is loaded.

By mastering variables and startup parameters, you’ll make your RPA workflows far more efficient, adaptable, and maintainable. Start implementing these today and take your automation to the next level!

Did this answer your question?