Skip to main content
Version: 6.1

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:

VariableDescriptionExample
{DATE}Current date2025-01-15
{TIME}Current time14:30:00
{USER}Current usernamejohn.doe
{REPORT}Report namePurchaseOrder
{COMPANY}Company codeACME

Custom Variables

User-defined variables for specific needs:

Variable TypeDescription
StaticFixed value that doesn't change
DynamicValue computed at runtime
ConditionalValue based on conditions

Defining Global Variables

Creating a Variable

  1. Navigate to System Settings → Global Variables
  2. Click Add Variable
  3. Define the variable properties:
PropertyDescription
NameVariable identifier (e.g., {ARCHIVE_PATH})
ValueThe value to substitute
DescriptionPurpose of the variable
TypeStatic, 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

VariableValueUsage
{ARCHIVE_ROOT}\\server\archiveBase archive location
{TEMPLATE_PATH}C:\TemplatesTemplate file location

Business Variables

VariableValueUsage
{DEPT_CODE}FINDepartment identifier
{REGION}EMEARegional designation

Variable Scope

ScopeDescription
GlobalAvailable to all reports and users
ReportSpecific to a report
UserSpecific 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.