Data Tab Reference
Reference guide for managing Mappings, Calculations, and Data Sources in the Template Designer.
The Data Tab in the Template Designer is where you define the logic behind your document. It connects your visual design to your actual data sources (Excel/CSV) and handles business logic like calculations and grouping.
Overview of Sections
The Data Tab is organized into the following sections:
- Mappings: Connects data file columns to template variables.
- Calculations: Creates new variables using formulas.
- Grouping (Required): Defines how rows are split into separate PDF documents.
- Data Linking: Joins Transaction data with Master data (VLOOKUP-style).
- Output Configuration: Sets the file naming convention for generated PDFs.
- Data Sources: Loads sample data for preview and mapping.
1. Mappings
Mappings allow the template to "read" values from your data source file columns.
- Transaction Data (receipt icon): Represents your main data (e.g., invoices, sales rows). This data typically varies with every row.
- Master Data (person icon): Represents reference data (e.g., customer list, product catalog). This data is often static or joined by an ID.
When you load a data source (see Data Sources below), mappings are often created automatically. You can also add them manually.
2. Calculations
Calculations allow you to create new variables derived from existing data. Use this to calculate amounts, taxes, or combine text fields.
Example:
To calculate a total price from UnitPrice and Quantity:
- Name:
TotalAmount - Formula:
{{UnitPrice}} * {{Quantity}}
Once created, {{TotalAmount}} becomes available as a variable in your design.
3. Grouping
This setting is mandatory. The Group key determines how multiple rows are processed.
- Single-Row Mode: If every row in your data represents one unique document, select a unique ID column (e.g.,
InvoiceID). - Multi-Row Mode: If your data contains multiple rows for a single document (e.g., an invoice with 5 line items), select the column that identifies the document (e.g.,
InvoiceID). The engine will group these 5 rows into one PDF.
Constraint
You must select the Group Key from the Transaction Data variables.
4. Data Linking
Use this section to join Master Data to your Transaction Data, similar to a VLOOKUP in Excel.
- Lookup Key (Import data): The column in your Transaction data acting as the "Foreign Key" (e.g.,
CustomerID). - Key Column (Master): The unique ID column in your Master data (e.g.,
CustomerID).
Why use this?
If your transaction data only has CustomerID "C001", but you want to print the customer's full address on the invoice, link your Master Data. The system will automatically pull the address associated with "C001".
5. Output Configuration
- PDF Naming Rule: Defines the filename of the generated PDF.
- Default:
{{InvoiceNo}}.pdf
You can use variables to create dynamic filenames, such as Invoice_{{InvoiceNo}}_{{Date}}.pdf.
6. Data Sources
This section helps you verify mappings and preview connection correctness. While manual mapping is possible, loading your actual data files reduces errors significantly.
Supported Formats
- CSV Files (
.csv) - Excel Files (
.xlsx,.xls)
How to Use
- Click Load Transaction Data or Load Master Data.
- Select your file from the file picker.
- A Data Preview dialog will appear.
- Review the data and click Load. The system will automatically propose mappings for all columns found in the file.
Status Indicators
- New: A mapping that will be added.
- Skip: A variable that already exists (duplicates are skipped).
Simulation
This feature works like the "Import Wizard" you see when creating a new profile. Loading data here does not "save" the data inside the template; it only saves the mappings (definitions) so the template knows how to read future files.