Tokens

Tokens are placeholders for dynamic data within documents. They work like variables that get replaced with values during document generation.

Each token, typically enclosed in curly braces {{token}}, is linked to a specific piece of data from a source, like a JSON file.

For example, to dynamically insert a client’s name into your template, you might define a token like {{Name}}. When the document is generated, this token will be replaced with the actual name, such as “John Doe”.

Template:

Template

JSON:

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

Result:

Result

Please review other examples:

Advanced cases

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

You can use special characters and spaces within your token names, but you’ll need to enclose the tag in square brakes inside the curly braces: {{[Full Name]}}.

Template:

Template

JSON:

{
 "num-1": 1,
 "num*2": 2,
 "Full Name": "John Doe"
}

Result:

Result

System tokens

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

  • {{@date}} provides the current date and time.

  • {{@number}} inserts a unique number into your document or Process parameters.

Note

Check out this article for more information about automatic numbering.

Let’s add these system tokens to our template:

Template with system tokens

And use the same JSON data we used earlier:

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

As we kick off the generation process, this is the result we’ll get:

Result with system tokens

Tokens in Processes

You can see the tokens used in your template by opening the token dialog in Processes.

To open the dialog, click the Tokens button in the template editor:

Tokens dialog

You can also change the types of tokens used in your template. Find out how it works here.

Tokens dialog

Check how the tokens work in: