Fill Template (HTML)

Overview
The Fill Template (HTML) node generates a dynamic HTML document by populating an uploaded HTML template (.html or .htm) with values from workflow properties and tabular data from an incoming DataFrame.
It performs two automated replacement phases:
- Table Injection: Replaces the
${TABLE}placeholder with a styled HTML table built from the incoming dataset. - Variable Replacement: Replaces all workflow property placeholders (e.g.,
${CUSTOMER_NAME},${ORDER_DATE}) with their runtime property values.
The resulting output is emitted as a NodeFile, ready to be attached to emails, converted to PDF, or published to external systems.
Purpose
Use this node when:
- Creating personalized HTML email bodies or report layouts (such as invoices, delivery notes, or status alerts).
- Embedding dynamic database query results or data preparation tables into a branded HTML template.
- Generating lightweight, styled HTML documents without writing custom server-side scripts.
- Feeding rendered HTML into downstream PDF nodes (such as PDF conversion or signing) for document publishing.
Configuration
Double-click the node on the canvas to open its configuration dialog:

| Field | Required | Default | Description |
|---|---|---|---|
| HTML-Template file | Yes | None | The base HTML template file (.html or .htm). Click BROWSE... or drag-and-drop a file from your local machine. |
| Table Style | No | TableGrid | The visual style applied when generating the HTML table for ${TABLE}. |
Table Styles
When injecting tabular data into ${TABLE}, B2Win Suite formats the table using inline CSS according to the chosen Table Style:

| Style Name | Value | Description | Styling Details |
|---|---|---|---|
| Standard grid table with borders (default) | TableGrid | Classic data grid with distinct borders | Solid 1px black border (#000000) on table, header cells, and data cells. |
| Simple table without borders | TableNormal | Clean, borderless table | Borderless layout with padded cells and bold headers. |
| Light shading table style | LightShading | Subtle light-gray shaded table | Light-gray border (#CCCCCC), #F2F2F2 header background, bordered data cells. |
| Light grid table style | LightGrid | Fine gray grid lines | #CCCCCC grid borders on all cells with #F2F2F2 headers. |
| Medium shading table style | MediumShading1 | Higher contrast shaded headers | Black cell borders (#000000) with darker gray header background (#D9D9D9). |
| Colorful grid table style | ColorfulGrid | Branded blue grid layout | Vibrant blue border (#4A90D9), blue header background with white text (#FFFFFF). |
| Professional table style | TableProfessional | Executive report presentation | Charcoal border (#666666), #E8E8E8 header background with 2px bottom border, subtle row dividers. |
Inputs
| Port Name | Title | Data Type | Description |
|---|---|---|---|
inputDataFrame | inputNodeFile | DataFrame | The tabular dataset (from Query, Visual Query, Data Prep, CSV Import, etc.) that will populate ${TABLE}. |
Outputs
| Port Name | Title | Data Type | Description |
|---|---|---|---|
outputNodeFile | outputNodeFile | NodeFile | A NodeFile containing the generated .html document with all variables and tables filled in. |
Processing Logic
The node executes the following pipeline at runtime:
1. Template Validation & Ingestion
- Confirms the uploaded file exists and has a
.htmlor.htmextension. - Reads the template content using UTF-8 character encoding.
2. Table Injection (${TABLE})
- If the template contains the token
${TABLE}, the node queries the incomingDataFramevia DuckDB (SELECT * FROM read_parquet(...)). - Column headers are resolved from the node schema descriptions (or default column names if descriptions are not set).
- An HTML table (
<table class="html-builder-table">) is constructed with the selected Table Style. - All cell text and header values are automatically HTML-escaped to prevent formatting errors and XSS vulnerabilities.
- If
${TABLE}is present in the template but no table data is supplied to the input port, the placeholder remains untouched.
3. Property & Variable Replacement
- Collects all available iteration properties and node properties from the workflow context (
input.getIterationAndNodeProperties). - Placeholders must follow the
${VARIABLE_NAME}format, where names contain alphanumeric characters and underscores ([A-Za-z0-9_]+). - Sorts variable keys by length in descending order to prevent partial keyword collisions (for example, ensuring
${CUSTOMER_ID}is evaluated before${CUSTOMER}). - Replaces each
${PROPERTY_NAME}token with its HTML-escaped string value:- If a matched property has a
nullvalue, the placeholder is replaced with an empty string (""). - If a placeholder has no corresponding property defined in the workflow, it is left unchanged in the document (e.g.,
${UNKNOWN_FIELD}), and a warning is recorded in the execution log.
- If a matched property has a
4. Output Generation
- The generated HTML file retains the exact filename of the uploaded template file (e.g.
order-summary.html) and is saved in the execution's working directory. Use a Rename File node downstream if you need a dynamic, timestamped, or customer-specific filename. - Emits the output as a
NodeFileon the output port.
Template Syntax & Example
Template File (order-summary.html)
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Order Confirmation</title>
<style>
body { font-family: Arial, sans-serif; margin: 20px; color: #333; }
h1 { color: #0056b3; }
.header-box { background: #f8f9fa; padding: 15px; border-radius: 4px; margin-bottom: 20px; }
</style>
</head>
<body>
<h1>Order Summary</h1>
<div class="header-box">
<p><strong>Customer:</strong> ${CUSTOMER_NAME}</p>
<p><strong>Order ID:</strong> ${ORDER_ID}</p>
<p><strong>Date:</strong> ${ORDER_DATE}</p>
</div>
<h2>Purchased Items</h2>
${TABLE}
<p><strong>Total Amount:</strong> $${TOTAL_AMOUNT}</p>
<p>Thank you for your business!</p>
</body>
</html>
Workflow Configuration
- Connect a source node (such as a database query returning line items) to the Fill Template input port.
- In the node dialog, upload
order-summary.html. - Choose a Table Style (e.g.
ColorfulGridorStandard grid table with borders). - Ensure upstream nodes or workflow properties define
CUSTOMER_NAME,ORDER_ID,ORDER_DATE, andTOTAL_AMOUNT. - Connect the output port to an email node (e.g., Send Email (SMTP) or Send Email (Outlook)) or a PDF conversion node.
Notes & Limitations
- Supported File Types: Only
.htmland.htmtemplate files are supported. For Word documents, see Fill Properties (Word); for Excel workbooks, see Fill Template (Excel). - Single Table Injection: The
${TABLE}token injects the entire incomingDataFrame. If multiple separate tables are needed, split them into separate workflow steps or pre-aggregate the data. - HTML Escaping: Variable values and table cell contents are automatically HTML-escaped (e.g.
<becomes<), preventing accidental tag injection or malformed document structures.