Tokens

A token is a bit of text that is automatically replaced with actual values when a Laserfiche Connector profile runs. Tokens allow you to get up-to-date information every time the profile runs, such as the current time, the user who ran the profile, and all the most recent information from the target application.

Tokens in Laserfiche Connector

Tokens are available in several places in the Profile Creation Wizard, depending on which action you configured for your profile

Laserfiche Connector also provides some system tokens automatically:

Tip: Laserfiche Connector has a slightly different syntax from other Laserfiche tokens. Laserfiche Connector requires a semi-colon to separate the token name and the formatting option: %(token;expression). To format date, time, or number tokens, use ICU formatting for dates and times or ICU formatting for numbers. Additionally, Laserfiche Connector needs to escape the characters: / and # wherever they appear in the token text with an extra forward slash. E.g., a token named "My/Slash/Token" with a regular expression "/+" would need to be formatted like: %(My//Slash//Token;#<//+>#). More advanced token options.

Using Tokens

Token can be used any place where the token button Token button appears next to a text box. Click the button, and select a token from the list that appears.

Editing Tokens

If you only want to use part of the value returned in a token, you can use regular expressions to extract just the information you need.

  1. Locate the token you want to edit, and click the token button Token button next to the text box it's in.
  2. Select Token Dialog. ClosedShow me where this is.
  3. How to open the Token Dialog

  4. In the token dialog box, you will see the tokens in the text box as underlined text. Click the token you want to edit.
  5. If the token is a multi-value token and you only want to return a specific value from that token, enter the index number of that value next to Apply index. Indexing starts at zero, so the first value in the token has an index of 0.
  6. Next to Regular expression, insert the regular expression to edit the token. The regular expression button has common character classes, character escapes, grouping constructs, and more that you can use to a build an expression. Place parentheses around the data you want to use from the token. Learn more about regular expressions.
  7. As you enter your regular expression, you will see the regular expression applied to the token as well as the value the token will return. This value is based on the information gathered as you've configured the profile and will changed based on the information available each time the profile runs.
  8. Click the Show tokens as plain text option at the top of the dialog box to see the formatted token and to see the results of your expression in the context of the entire contents of the text box. This option is especially helpful if you're editing multiple tokens in the same text box.
  9. Example: You want to scan documents to the following folder path: \Clients\Zip Code\Last Name. Laserfiche Connector is configured to grab the client's name and address from SharePoint and create tokens from those controls.

    Name and address in SharePoint

    On the Scan Options page, insert the tokens from these controls into the Folder path field. (E.g., \Client\%(Address)\%(Name).)

    Example configuration of the scan options page

    Select the token button again, and choose Token Dialog. Select the Address and Name tokens and apply regular expressions to each of them. Then click Show tokens as plain text to see the resulting folder path.

    Edited tokens in the folder path

Multi-value Tokens

You can create multi-value tokens in Laserfiche Connector by giving multiple tokens the same name on the Define Token page of the Profile Creation wizard. These multi-value tokens can be inserted into multi-value fields in Laserfiche or other applications. Additionally, you can apply an index these tokens to return specific values from them.

If you need to use a single value from a multi-value token, you can apply an index to the token to retrieve the value need. There are two options for applying indexes.