Token Functions

Token functions allow you to edit a token value with one or more pre-configured operations. All available token functions are accessible through the Token Editor dialog box.

Note: Applying a token function will only change the value of the token in that one location. If you want all instances of a token value changed to be the result of a function, use Assign Token Value to create a token with the new value.

To configure token functions

  1. To open the Token Editor dialog box, right-clicking any token that appears inside a text box and select Token Editor in its context menu.
  2.  In the ClosedToken Editor dialog box, select the checkbox next to Apply Function then click Select a function.

  3. In the ClosedToken Functions dialog box, move the functions you want to apply to the token from the left column to the right column by clicking the green right arrow . Functions will be applied to the token in the order they appear in the right column. You can change the order by selecting the function you want to move and using the green up-and-down arrows .

    Note: Operations in the Token Editor are applied in the following order: function, index, formatting, regular expression.

  4. Click OK to return to the Token Editor. Below are the different functions you can apply. 
    • Average: Determines the average of all values in a multi-value token and replaces the token with the average. Non-numeric values will be ignored.
    • Encode URI: Converts a token's characters (except RFC 2396 unreserved characters) to their hexadecimal representation so the token can be used in a web address. ClosedShow me an example. More information.
    • Encode XML: Allows you to escape XML characters, such as <, >, ", ', and &, and replace them with their encoded values. Choose this option if your token includes XML characters you want displayed as text in emails or other places. If you do not encode the XML with this function, email clients may try to interpret the XML instead of simply displaying the text. ClosedShow me an example.
    • Max: Determines the largest value in a multi-value token and replaces the token with the largest value.
    • Min: Determines the smallest value in a multi-value token and replaces the token with the smallest value.
    • Remove Duplicates: Removes duplicate values from multi-value tokens.
    • Remove Empty Items: Removes empty values from multi-value tokens.
    • Sort Ascending: Organizes the values in a multi-value token from smallest to largest.
    • Sort Descending: Organizes the values in a multi-value token from largest to smallest.
    • Split: Divides a single-value token into a multi-value token. The single-value token is divided whenever a specified character or characters appears in the token. When you apply this function, a text box appears for you to specify the characters the token will be divided at. ClosedShow me what this looks like. ClosedShow me an example.

      Tip: If the single-value token has spaces between the delimiter and the next value, combine this function with the "Trim" function to remove those extra spaces from the multi-value token.

    • Sum: Adds together all the values in a multi-value token and replaces the token with the sum.
    • Text Length: Counts the number of characters in the token's value and replaces the token with this number.
    • To Lower: Converts all letters in the token's value to lowercase.
    • To Title Case: Capitalizes the first letter of each word in the token to uppercase. If a word in the token is all capital letters (like an acronym) it will not be affected by this function. If there is a capital letter in the middle of the word, it will convert that letter to lowercase (i.e., "helLo" will be converted to "Hello," and "O'Neil" will be converted to "O'neil.").

      Tip: If your token is in all capital letters and you want to convert it to title case, first apply the "To Lower" function and then the "To Title Case" function.

    • To Upper: Converts all letters in the token's value to uppercase.
    • Trim: Removes any white spaces before or after a token's value.
    • Value Count: Counts the number of values in a multi-value token and replaces the token with this number.