Token Syntax
Tokens have the following format (syntax): %(TokenName). This syntax lets both you and the software know when a bit of text will behave like a token.
Note: The syntax used for tokens has changed from Laserfiche 7 to Laserfiche 8 and later. All tokens should now be in the following format: %(token).
You can edit the syntax even further if you want to apply functions, indexing, formatting, or regular expressions. However, the Token Dialog and Token Editor will automatically create this syntax for you when you choose different options in these dialog boxes.
- Functions: %(TokenName#@FunctionName@#). The function's name is placed between #@ and @#. Multiple functions are separated by a semi colon. If the function has a parameter, such as if you specified a delimiter for the Split function, then the parameter is placed between parentheses: %(TokenName#@FunctionName(Parameter)@#).
- Indexing: %(TokenName_All#[n]#) where n equals the index number of the value you want the token to be replaced by. The syntax to have a token be replaced by all values separated by a delimiter is: %(TokenName_All#[delimiter]#). The delimiter is placed between #[ and ]#.
- Formatting: %(TokenName#".NET formatting expression"#). A .NET formatting expression is placed between #" and "#.
- Regular Expressions: %(TokenName#<RegularExpression>#). The regular expression is placed between #< and >#, directly after the token name.

Example: If you precede a token with a forward slash, when the session runs, the token itself will be returned and not its value. For instance, you want to use a token when defining a URL in a field, and you type: http://CompanyName/%(EmployeeID) in the field. When the session runs, the /%(EmployeeID) will be replaced with the characters /%(EmployeeID) instead of a forward slash and the token value. To return the token value, escape the forward slash with another forward slash. For example, http://CompanyName //%(EmployeeID) would return http://CompanyName/12345.
Example: You want to delimit a multi-value token with the character "]". Because "]" has syntactic meaning when indexing a token, you will need to escape it in the token's syntax: %(TokenName_All#[/]]).