Skip to content

Template

The Template node renders a template string with embedded expressions for each input row. Use it to build formatted text, HTML snippets, email bodies, or any string output.

Configuration

PropertyTypeDefaultDescription
templatestring--Required. A template string with { { }} or <{ }> expression blocks.
outputFieldstring_textThe field name where the rendered text is stored on each row.

Input

Accepts a single object or an array of rows.

Output

  • Single object: The rendered text is added as outputField.
  • Array of rows: Each row gets the rendered text as outputField.
  • Non-array input: Returns the rendered string directly.

Template Syntax

{ { expression }} -- Escaped text output

Evaluates the expression and escapes the result for safe display:

Hello, `{ {row.name}}`! You have `{ {row.count}}` items.

<{ expression }> -- Raw HTML output

Evaluates the expression and sanitizes via wp_kses_post() (allows safe HTML tags):

<{content(row.post_content)}>

Expression Context

VariableDescription
rowThe current row being processed
inputSame as row (for single-object input)

Example Templates

Simple greeting

Welcome back, `{ {row.display_name}}`!

Email body

Dear `{ {row.name}}`,

Thank you for your order #`{ {row.order_id}}`.
Total: $`{ {number_format(row.total, 2)}}`

Best regards,
The Team

HTML content rendering

<{content(row.post_content)}>

Conditional text

Status: `{ {row.status == 'active' ? 'Active' : 'Inactive'}}`

Example Use Cases

Generate email content in a form pipeline

Context --> Validate --> Template (email body) --> Send Email --> Output

Create display labels

Table Query --> Template ("`{ {row.first_name}}` `{ {row.last_name}}`") --> Result

Build custom URLs

template: "/products/`{ {slug(row.title)}}`-`{ {row.id}}`"
outputField: "url"

TIP

The Template node is ideal for multi-line text with embedded expressions. For setting a single field to a computed value, the Set Field node is simpler.