Variables & Tokens Reference
A Pactly template is a Word document marked up with tokens. When someone generates a contract, Pactly reads each token, looks up its value, and writes the result into the document. This page is the reference for that markup language, PCTL (Pactly Contract Templating Language): every token type, what it resolves to, and the rules that decide where each one can go.
You write these tokens while authoring a template in the Pactly Word add-in. The people who later generate contracts never see them. If you are building or fixing a template, keep this page open.
Double curly braces wrap every token. A single brace — or a typo in the case below — and the token will not resolve.
The token name, written in camelCase with no spaces or underscores. This is the part Pactly looks up and replaces at generation time.
Token name — looked up and replaced The one rule — braces and case must be exact
The token families
{{ContractValue}} VariableA value from a contract property — US$120,000
{{vm AgreementType}} Value mapThe text of a selected choice — “mutual NDA”
{{if hasRenewal}} … {{/if}} ConditionalContent shown only when the flag is true
{{rule Sanctioned}} … {{/rule}} RuleA named clause switched on or off
{{party1.entityName}} Party fieldAn attribute of a party — Acme Corp.
{{@currency}} GlobalA system value — the currency symbol US$
Token cheat-sheet
Section titled “Token cheat-sheet”Every token type at a glance. The sections below add the detail each one needs.
| Token | Syntax | Resolves to |
|---|---|---|
| Variable | {{VariableName}} | A value pulled from a contract property (text, number, date) |
| Value map | {{vm MapName}} | The text of a selected dropdown choice |
| Value map by index | {{vm MapName #2}} | The Nth selected choice from a multi-select |
| Global | {{@currency}} | A system value (currency symbol, year, company name) |
| Computed | {{#TotalCost}} | The result of a math expression defined on the template |
| Conditional | {{if Var}}...{{/if}} | Content shown only when Var is true |
| Negated conditional | {{if !Var}}...{{/if}} | Content shown only when Var is false or empty |
| Rule | {{rule Name}}...{{/rule}} | A clause shown only when the named rule is true |
| Complex rule | {{rules A && B}}...{{/rules}} | A clause shown when a boolean expression is true |
| Party field | {{party1.entityName}} | An attribute of a party on the contract |
| Embed | {{embed AttachmentA}} | An attached document injected into the output |
| Auto field | {%reference%} | A value set automatically at generation time |
Variables
Section titled “Variables”A variable is the most common token. It substitutes a single value, usually one a requester typed or selected on the intake form.
The total contract value is {{ContractValue}}.A variable draws its value from the contract property it is mapped to. Three formatting options are set on the variable definition, not in the token:
- Uppercase renders the value in capitals.
- Currency prepends the contract’s currency symbol.
- Number format controls how numbers print: a plain
number(1234.56),thousandswith separators (1,234,567.89), or spelled-out as astring(one thousand two hundred thirty-four).
Value maps
Section titled “Value maps”A value map turns a dropdown choice into document text. The choice the requester picks has a hidden label and a visible replacement value; the token prints the replacement.
This is a {{vm AgreementType}} agreement.If a value map allows multiple selections, address a specific one by index with #N:
Primary service: {{vm Services #1}}Secondary service: {{vm Services #2}}Value maps are also what let one template serve several variants. A single template can render an NDA, a service agreement, or a license from the same document, with the value map and a few rules deciding the wording, rather than three near-identical templates.
Globals
Section titled “Globals”A global is a system value, the same for every contract, so it has no property to map.
| Global | Resolves to |
|---|---|
{{@currency}} | The selected currency symbol (S$, US$, €, A$, Rp) |
{{@year}} | The current year |
{{@CompanyName}} | Your organization’s name |
Globals are commonly paired with a variable, for example {{@currency}}{{ContractValue}} to print a symbol and amount together.
Computed values
Section titled “Computed values”A computed value runs a small math expression over other values and prints the result. You define the expression (such as BaseAmount + TaxAmount) on the template, then reference it by name.
Total payable: {{#TotalCost}}Supported operators are +, -, *, /, ||, and &&. Computed values are an advanced feature; most templates never need them.
Conditionals
Section titled “Conditionals”A conditional shows or hides content based on a true/false value. Add ! before the name to invert it.
{{if hasRenewal}}This agreement renews automatically at the end of each term.{{/if}}
{{if !isExempt}}Standard compliance requirements apply.{{/if}}Conditionals can test a party attribute too, which is how a template branches between an organization and an individual:
{{if party1.isEntity}}Executed by an authorized representative of {{party1.entityName}}.{{/if}}{{if !party1.isEntity}}Executed by {{party1.firstName}} {{party1.lastName}}.{{/if}}A rule is a named condition you define on the template, then reference to switch a clause on or off. Use a rule when the condition has a meaning worth naming (Sanctioned, Preferred, HighValue) or combines several inputs.
{{rule Sanctioned}}This party is subject to additional sanctions-compliance requirements.{{/rule}}Prefix the name with ! to show the clause when the rule is false:
{{rule !Exempt}}Standard terms apply to this agreement.{{/rule}}Complex rules
Section titled “Complex rules”When a clause depends on more than one condition, write the boolean expression inline with {{rules ...}}. Combine flags with && (and), || (or), ! (not), and parentheses.
{{rules isCommercial && hasApproval}}This commercial agreement has received the necessary approvals.{{/rules}}
{{rules (Sanctioned || SensitiveEntity) && isCommercial}}Enhanced due diligence requirements apply.{{/rules}}Boolean rules and the four-branch pattern
Section titled “Boolean rules and the four-branch pattern”PCTL cannot nest one conditional inside another. To cover every combination of two flags, write four separate {{rules}} blocks instead of nesting:
{{rules A && B}}Text when both A and B are true{{/rules}}{{rules A && !B}}Text when A is true but B is false{{/rules}}{{rules !A && B}}Text when B is true but A is false{{/rules}}{{rules !A && !B}}Text when neither is true{{/rules}}This flattening pattern replaces nesting everywhere. It is verbose but reliable. For a fuller walk through rules, complex expressions, and party-type branching, see Conditional Logic and Rules.
Party fields
Section titled “Party fields”A party field prints an attribute of a party on the contract. The number addresses which party (party1, party2); the attribute follows the dot.
{{party1.entityName}}{{party1.firstName}} {{party1.lastName}}{{party1.email}}Common built-in attributes:
| Attribute | Value |
|---|---|
firstName / lastName | Individual’s name |
email | Email address |
address | Physical address |
country | Country |
entityName | Organization name |
entityRegNo | Registration number |
isEntity | True if the party is an organization |
isSanctioned | True if flagged by a sanctions check |
Custom party attributes are addressed by their key in the flat form, one level deep, for example {{party1.department}}. The nested {{party1.customAttributes.department}} form does not resolve in generated documents.
Auto fields
Section titled “Auto fields”Auto fields use a different wrapper, {%...%}, and are filled automatically when the document is generated, with no property to map.
| Auto field | Resolves to |
|---|---|
{%reference%} | The contract’s reference number |
{%effectiveDate%} | The contract’s effective date |
{%year%} | The current year |
The missing-value marker
Section titled “The missing-value marker”When a token has no value to resolve, Pactly does not fail the generation and does not leave the raw token in place. It writes a bullet-in-circle placeholder, a black dot in a circle, where the value would have gone.
That marker is your signal that something upstream is wrong. The usual causes:
- The token name is misspelled, so it matches no variable (
{{ContractVlaue}}). - The variable is not mapped to a contract property.
- The form field that feeds the property was left blank.
- A custom party attribute did not resolve (see Party fields above).
There is no validation before generation. A typo in a token or a broken rule name stays invisible until you generate a document and see the marker. When reviewing a new template, always generate a test contract and scan the output for these dots.
Block tokens vs inline tokens
Section titled “Block tokens vs inline tokens”PCTL distinguishes between tokens that wrap whole paragraphs (block) and tokens that sit inside a line of text (inline). Getting this wrong is the most common reason a clause silently fails to appear.
A block token must occupy its own paragraph. The opening tag, the content, and the closing tag each sit on their own lines. Block mode is what lets a condition remove an entire section.
{{if hasRenewal}}RENEWAL. This agreement renews automatically......further renewal terms...{{/if}}An inline token sits within a sentence and cannot span multiple lines.
The status is {{if isActive}}active{{/if}}.This table shows where each token type is allowed:
| Token | Block | Inline |
|---|---|---|
{{if Var}}...{{/if}} | Yes | Yes |
{{rule Name}}...{{/rule}} | Yes | Yes |
{{rules expr}}...{{/rules}} | Yes | Yes |
{{vm MapName}} | Yes (own paragraph) | Yes |
{{VariableName}} | No | Always inline |
{{@global}} | No | Always inline |
{{#computed}} | No | Always inline |
{{party1.attr}} | No | Always inline |
Limits worth memorizing
Section titled “Limits worth memorizing”A handful of constraints catch almost every template author:
- No nesting. You cannot put
{{if}}inside another{{if}}. Use a combined{{rules A && B}}instead. - A variable inside an inline rule does not work. If a
{{rule}}block contains a variable, the rule must be in block mode (its own paragraphs), not inline. - A value map inside an inline rule does not work. Put the
{{vm ...}}on its own paragraph inside a block rule. - No line breaks inside an inline token. An inline token must stay on one line.
- Template edits affect new contracts only. Changing a template does not update contracts already generated from it; regenerate them to apply the change.
Related
Section titled “Related”- Templates Overview
- Create a Template: where these tokens are written and configured
- Conditional Logic and Rules: the deeper guide to rules and party-type branching
- Mappings: Forms, Properties, and Template Tokens: how form answers reach a token
- Field Mappings and Naming: connecting form fields to contract properties
Chat with us
We typically reply within a few minutes