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.
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.
| 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”} |
There are several ways to create variables
The Variables tab defines the variables to be updated during the action’s execution.
- `<username>` OS user name
- `<computername>`
- `<datetime>`
- `<CurrentDateTime>`
- `<CurrentDate>`
- `#PACKAGE_LOGS#` Holds the list of log files created by a package
For more technologies supported by our ETL Software see Advanced ETL Processor Versions
Confused? Ask question on our ETL Forum