Global Variables
Global Variables allow you to define reusable variables that can be used across all reports and conversions in B2Output.
Overview
Global Variables provide a way to:
- Create dynamic values for file names, paths, and content
- Define system-wide variable substitutions
- Centralize commonly used values
Variable Types
System Variables
Built-in variables provided by B2Win Suite:
| Variable | Description | Example |
|---|---|---|
{DATE} | Current date | 2025-01-15 |
{TIME} | Current time | 14:30:00 |
{USER} | Current username | john.doe |
{REPORT} | Report name | PurchaseOrder |
{COMPANY} | Company code | ACME |
Custom Variables
User-defined variables for specific needs:
| Variable Type | Description |
|---|---|
| Static | Fixed value that doesn't change |
| Dynamic | Value computed at runtime |
| Conditional | Value based on conditions |
Defining Global Variables
Creating a Variable
- Navigate to System Settings → Global Variables
- Click Add Variable
- Define the variable properties:
| Property | Description |
|---|---|
| Name | Variable identifier (e.g., {ARCHIVE_PATH}) |
| Value | The value to substitute |
| Description | Purpose of the variable |
| Type | Static, Dynamic, or Conditional |
Variable Syntax
Variables are enclosed in curly braces:
{VARIABLE_NAME}- Simple variable reference{DATE:YYYY-MM-DD}- Variable with format specifier{USER.EMAIL}- Nested property reference
Using Variables
In File Names
{REPORT}_{DATE}_{USER}.pdf
Results in: PurchaseOrder_2025-01-15_john.doe.pdf
In Archive Paths
\\server\archive\{COMPANY}\{DATE:YYYY}\{DATE:MM}\
Results in: \\server\archive\ACME\2025\01\
In Email Templates
Variables can be used in:
- Email subject line
- Email body content
- Recipient addresses
Custom Variables Examples
Path Variables
| Variable | Value | Usage |
|---|---|---|
{ARCHIVE_ROOT} | \\server\archive | Base archive location |
{TEMPLATE_PATH} | C:\Templates | Template file location |
Business Variables
| Variable | Value | Usage |
|---|---|---|
{DEPT_CODE} | FIN | Department identifier |
{REGION} | EMEA | Regional designation |
Variable Scope
| Scope | Description |
|---|---|
| Global | Available to all reports and users |
| Report | Specific to a report |
| User | Specific to a user |
Best Practices
tip
- Use descriptive variable names
- Document the purpose of each variable
- Use consistent naming conventions
- Test variable substitutions before production use
- Keep the number of global variables manageable
warning
Be careful when changing global variable values, as it affects all reports that use them.