Skip to content

How to Fix Confluence Template Variable Not Working

DodaTech Updated 2026-06-24 2 min read

In this tutorial, you'll learn about How to Fix Confluence Template Variable Not Working. We cover key concepts, practical examples, and best practices.

Confluence template variables like $projectName or @{reporter} show as raw text instead of being populated. Variables work only in blueprints and specific template contexts.

The Wrong Way

// Typing ${projectName} directly in a Confluence page
page.content += '${projectName}';

Confluence does not process variables in regular pages. Variables only work within blueprint templates during page creation.

The Right Way

Step 1: Use blueprint templates

# Create → select a blueprint (not "Blank page")
# Blueprints that support variables:
# - Decision
# - Meeting Notes
# - Project Plan
# - Technical Documentation

Step 2: Define variables at creation

When you create a page from a blueprint:

# A dialog appears asking for:
# Project name, lead, date, etc.
# Fill these in — they populate the ${variable} placeholders

Step 3: Use the variable syntax correctly

# Blueprint variables use:
# ${variableName} — text substitution
# @{reporter} — user mention
# @{date} — current date
# @{time} — current time

These only work inside blueprint templates, not in regular Content Formatting macros.

Step 4: Check the blueprint template definition

# Space Settings → Content Tools → Blueprint Templates
# Select the blueprint → Edit
# Variables are defined as:
# <variable name="projectName" label="Project Name" type="text" />

If the variable definition is missing, add it to the template XML.

Blueprint "Meeting Notes" creates a page with: "Meeting: Sprint Planning — Date: 2026-06-24 — Led by: @john"

Prevention

  • Only use blueprint templates for pages that need dynamic fields.
  • Test variable population with a sample page before rolling out to the team.
  • The template variable system is comparable to Doda Browser's bookmark templates, where {title}, {date}, and {url} placeholders auto-populate from context.

Common Mistakes with template variable

  1. Using foldl instead of foldl' causing stack overflow on large lists
  2. Forgetting deriving (Show, Eq) on custom data types needed for debugging
  3. Placing the wildcard pattern first in case expressions, making all subsequent patterns unreachable

These mistakes appear frequently in real-world CONFLUENCE code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

### Why do my Confluence template variables show as raw text?

You are probably pasting $variableName in a regular page instead of using a blueprint template. Blueprint variables render only during page creation from a blueprint. After creation, the values are static text.

Can I create custom variables in Confluence?

Yes. Edit the blueprint template in Space Settings → Content Tools → Blueprint Templates. Add <variable name="customVar" label="Custom Field" type="text" /> to the template XML.

Do Confluence template variables support dropdowns or date pickers?

Yes. The variable type attribute supports: text, textarea, select, date, user, multiuser, and page. For select types, add <option value="val">Label</option> elements.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro