ReportBurster Variables Interpolation/Templating
Learn how to use variables in ReportBurster to create dynamic configurations and personalized document delivery.
Table of Contents
- Introduction
- Using Variables
- Example - Unique Output Folders
- Built-In Variables
- User-Defined Variables
Introduction
ReportBurster variables are pieces of information from the input report, evaluated and processed individually for each output report. They allow you to create dynamic configurations and personalized document delivery.
Variables can be used to define dynamic values that change for each recipient or report, making your document distribution both efficient and personalized.
Using Variables
Variables can be used to define custom dynamic values for the following configurations:
- Burst File Name - customize how output files are named
- Output Folder - determine where files are saved
- Backup Folder - set dynamic backup locations
- Quarantine Folder - configure where failed documents are stored
- Upload Commands - dynamically generate FTP, File Share, or other upload URLs
- Email Fields - customize To, CC, and BCC fields dynamically
- Email Content - personalize email subjects and messages
- Email Settings - customize connection settings including From Name, From Email Address, Host, User Name, Password, and Port
Using variables, these configurations are dynamically populated at run-time with information extracted from the report being processed.
Example - Unique Output Folders
While static output folders are possible, they're not advisable as files may be overwritten between burst sessions. Variables solve this problem by creating unique time-stamped folders.
Using variables helps in situations where:
- The same report is burst at different times
- Different reports use the same burst tokens
ReportBurster's default pattern for output folders is:
${input_document_name}/${now?string["yyyy.MM.dd_HH.mm.ss.SSS"]}
For example, when bursting samples/Payslips.pdf
, output files are generated in a folder like Payslips.pdf/2023.03.04_19.13.13
.
Built-In Variables
Built-in variables include the report name, date formats, and burst tokens. These are available in all ReportBurster configurations.
The following built-in variables are available:
${input_document_name}
- the file name of the input report${input_document_extension}
- the file extension (pdf, xls, xlsx)${burst_token}
- the burst token used for the current file${burst_index}
- the index of the burst file (e.g., 4 for the fourth file)${output_folder}
- the output folder where the last file was extracted${extracted_file_path}
- the path to the last extracted file${now?string["yyyy.MM.dd_HH.mm.ss.SSS"]}
- the current date/time in specified format${now_default_date}
- shortcut to default date format (e.g., Jun 30, 2023)${now_short_date}
- shortcut to short date format (e.g., 6/30/23)${now_medium_date}
- shortcut to medium date format (e.g., Jun 30, 2023)${now_long_date}
- shortcut to long date format (e.g., June 30, 2023)${now_full_date}
- shortcut to full date format (e.g., Tuesday, June 30, 2023)
Using built-in variables, you can create advanced archiving configurations:
- Generate one different output folder per input report
- Generate one different output folder per burst token
- Date-based folders (year, quarter, month, week, day, hour, minute, second)
Example - samples/Payslips.pdf
ReportBurster's default setting for Burst File Name is:
${burst_token}.${input_document_extension}
When bursting the samples/Payslips.pdf
report, three files are generated. The burst tokens are email addresses, and .pdf
is the input document extension.
User-Defined Variables
User-defined variables can be any text from the report being processed. They're perfect for:
- Creating personalized email subjects and messages
- Generating dynamic file names and folder structures
- Customizing delivery parameters for each recipient
ReportBurster supports a configurable number of user-defined variables (20 by default): ${var0}
, ${var1}
, ${var2}
, .. ${var19}
.
These variables are populated with text content from the report. To define them, ReportBurster searches for patterns like:
<0>any text for variable 0</0>
<1>any text for variable 1</1>
Each variable can have different values for different burst tokens or recipients.
Example - Customizable Burst File Names (samples/Invoices-Oct.pdf
)
With default settings, ReportBurster generates output file names using:
${burst_token}.${input_document_extension}
Let's say you want to generate file names using this pattern instead:
Customer name-Invoice number-Invoice date.pdf
This can be achieved with user-defined variables. In the samples/Invoices-Oct.pdf
report:
- Invoice number is configured as the burst token
- Customer name is mapped to
${var1}
- Invoice date is mapped to
${var0}
Define Burst File Name as:
${var1}-${burst_token}-${var0}.pdf
Variables are fetched at runtime from each invoice. For example, the generated file might be:
Alpha Electric-0011-Oct 10, 2023.pdf
Bursting samples/Invoices-Oct.pdf
will generate four distinct files:
Note: To prevent visual clutter in your reports, consider setting the variable tags (e.g.,
<0>
and</0>
) to white font color or placing them in hidden areas of your document. This ensures the tags are processed by ReportBurster but remain invisible to the end recipients.
Important: Before going to production, practice using variables on sample reports to avoid sending incorrect data to clients.
Custom Email Messages
ReportBurster supports sending of personalized email messages which have the corresponding burst report attached to the email.
Using variables, the subject and the text of the email messages can be dynamically configured and customized for each individual recipient.
Example - In the previous screenshot, when each individual report is being distributed, ${var0}
, ${var1}
and ${var2}
variables will be replaced with values fetched from the burst report such
as John
, July
and Michelle
.
Following is the message which is sent when the variables are expanded with the values John
, July
and Michelle
Hi John
,
Attached you can find the invoice for the
month of July
.
Thank you,
Michelle
Excel User-Defined Variables
While the concept is the same as with PDF reports, Excel user-defined variables are defined differently:
- Excel user-defined variables can be declared in the
userVariables
column from theburst
metadata sheet - Variables are enclosed between
<0>value</0>
,<1>value</1>
, etc. - For example, the value for
var0
(associated with "Germany" burst token) is "Alfreds Futterkiste" and the value forvar1
is "Berlin"