Using Variables

Package variables are used to store and manage data within a package, enabling dynamic and flexible execution. They act as placeholders for values that can be referenced, modified, and passed between different actions in the package.

Uses of Package Variables:

Data Sharing Between Actions:

Variables enable actions to share information, ensuring continuity and context throughout the package.

Example: Storing a file path in one action and using it in another for processing.

Dynamic Parameterization:

Allow packages to adapt to changing inputs or conditions by using variables instead of static values.

Example: Dynamically calculating and storing a discount rate based on customer data.

Decision-Making:

Variables can store values used in conditional logic, allowing packages to make decisions dynamically.

Example: Using a variable to decide whether to send an email notification based on order status.

Data Validation and Manipulation:

Store intermediate results for processing or validating data within the package.

Example: Extracting and validating a user’s email address before sending a message.

Looping Through Data:

In loop actions, variables can hold the current iteration’s value, such as a file name or database record.

Example: Processing each line of a file or iterating through email messages.

Temporary Data Storage:

Hold temporary data that is only needed during the package’s execution.

Example: Storing API responses for further processing in subsequent actions.

Debugging and Monitoring:

Variables can be logged or inspected to debug packages and track progress.

Example: Capturing error messages or execution details to troubleshoot issues.

Example Use Cases

Variable Purpose Example Value
#CurrentFile# Stores the name of the file being processed invoice_2024.pdf
#TotalAmount# Holds the total amount calculated for an order 1500.75
#IsApproved# Tracks approval status for a task true
#IterationID# Stores the ID of the current loop iteration 5
#APIResponse# Saves the response from an API call for further analysis {“status”:“success”}

Variable parameter

Variable Parameter Text

  • Variables are substituted with their actual values before the action is executed.
  • Multiple variables are supported.
  • The Variable Selection dialog is populated after the package is executed.
  • Double-click on the parameter to open the text editor.

Creating Variables

There are several ways to create variables

  • Using Script Action
  • Using transformation action
  • Using calculation object within transformation action
  • Using Global Variables
  • Using Calculated Parameters
  • By loading variable(s) from a file
  • By loading variable(s) from a database

Setting Variable

The Variables tab defines the variables to be updated during the action’s execution.

Show Message Action - Variables tab

Predefined variables

- `<username>` OS user name
- `<computername>`
- `<datetime>`
- `<CurrentDateTime>`
- `<CurrentDate>`
- `#PACKAGE_LOGS#`  Holds the list of log files created by a package

Variables Actions

  1. Load Variable Action
  2. Delete Variable Action
  3. Select Value Action
  4. Set Variables Action
  5. File to Variables Action
  6. File Line to Variables Action
  7. SQL Record to Variables Action
  8. SQL to Variables Action
  9. Command Line Parameters Action

Video Tutorial




For more technologies supported by our ETL Software see Advanced ETL Processor Versions

Confused? Ask question on our ETL Forum

Posted on June 9, 2025 • 3 min read • 545 words
www.etl-tools.com About Support Pricing Cookies Policy Term Of Use Privacy Policy License