SureDraft Get it on Atlassian MarketplaceStart free

AnswersConfluence

How do I define a variable once in a Confluence template and use it through the page?

The short answer

Confluence Cloud already does this.

Give the variables the same name and one typed value fills every copy. What it won't do is keep them connected: once the page is created, each value is ordinary text that has to be changed by hand, one place at a time.

How to do it in Confluence

1

A template

Open Space settingsLook and FeelTemplates, and create or edit a template.

2

A variable

Type /variable and press Enter. Select the new variable, select it again to edit it, name it, and choose Text, Multi-line Text or List.

3

The same name

Wherever the same value belongs, add another variable with the same name.

Atlassian's documentation calls same-named variables "copies of the same variable".

The text entered for one appears everywhere a copy appears.

One older answer, from 2020 and tagged Confluence Server, describes one box for every copy. A 2024 answer about Cloud says the template "will prompt for a value for this variable only once".

Either way, one name means one value.

Where it stops

  • The copies stop following each other once the page is created. A wrong client name in six places is six edits.
  • It only works in a template. A page that already exists has no variables.
  • A variable can't be made required. Atlassian's request for that option has been open since 2021.

Six edits is where one gets missed.

When you need more

SureDraft, an app for Confluence, keeps one answer tied to every place it belongs until the copy is approved.

  1. It starts from a page you already have. You mark the words that change and write a question for each.
  2. To mark a phrase everywhere at once, type it into Find in document in SureDraft's survey editor and press Mark all. All the marks share one question, so one answer fills them all.
Writing a question for a marked spot in a policy

THE DRAFT

The copy that comes back is a new page, which SureDraft calls a draft.

Until the draft is approved, Edit answers reopens the questions and Update draft rewrites the same page, so a corrected name changes everywhere at once.

A draft ready for review with its answers highlighted and an Approve button

When the built-in variables are enough

  • Meeting notes, project pages, status reports: pages that are meant to be edited after they are created.
  • One person creates the page and owns everything on it.
  • Nobody will ever ask who typed what.

What SureDraft is for

  • The document whose wording someone approved.
  • The people with the answers shouldn't be the people who edit it.
  • Each copy has to be approved and traceable.