Tokens in Classic engine

Classic templating engine

This page describes only the Classic templating engine.

Still using Modern syntax? See the Modern documentation.

Learn the differences.

This article explains how to use tokens in the Classic template engine.

Token basics

Tokens in Classic template engine are placeholders to insert dynamic data. They act as variables and replaced with actual values when the document is generated. They are enclosed in {{curly braces}} and represent fields from a data source like JSON.

For example, if you’re generating a document and you want to insert the client’s name dynamically, you might define a token like {{Name}}.

When generating the document, this token would be replaced with the actual name, such as “John Doe”.

Template:

Classic template

JSON:

{
  "Name": "John Doe",
  "OrderNumber": "171024"
}

Result:

Classic result

Plumsail tokens can also be used in more complex ways, allowing you to

System tokens

There are two system (predefined) tokens: {{@date}} and {{@number}}. System tokens use @ as a prefix.

  • {{@date}} token provides full current date with time.

  • {{@number}} token inserts unique numbers in a document or in Process’ parameters.

Note

Review the article to get more information about automatic numbering.

If we add the system tokens to our template:

Classic template with system tokens

And use the same JSON:

{
  "Name": "John Doe",
  "OrderNumber": "171024"
}

We’ll get this result:

Classic result with system tokens

Tokens in Processes

Tokens that are used in the template are available in the tokens panel in Processes.

To open the panel, click the Tokens button above the template editor:

Classic tokens button panel

You can also change the types of tokens extracted from your template. Learn how it works.

Classic tokens panel example