CSM 10.4 Documentation

Home

Text Modifiers

A text token displays a value or string of text.

An example of a text modifier is the Last Edited text on the Incident form.

The following modifiers can be applied to text tokens.

Note: Text modifiers are designed to target plain text only. Rich text content is not currently supported.

As XML

Returns text as an XML element.

Contains

Determines whether another string is contained within the source string. Example:

  • Original token: Now is the winter of our discontent
  • Modifier: Contains (winter)
  • Result: True
Ellipse Text

Used to truncate a string if it is too long. If the string is longer than the specified length, then the value has an ellipsis (…) added to the end.

Spaces are included in the character count for this modifier.

Example:

  • Original token: Now is the winter of our discontent
  • Modifier: Ellipse Text (20)
  • Result: Now is the winter…
Encode Text Applies the selected encoding method to text. You can choose from:
  • Base 64
  • Backslash CR LF
  • Backslash Quote
  • Double Quote
First Word

Returns the first word in a string.

Example:

  • Original token: Now is the winter of our discontent
  • Modifier: First Word
  • Result: Now
Hash Text

Applies cryptographic hashing algorithms to text strings. This enables you to create encrypted strings you can use to create tokens for APIs and to detect data changes.

Available hash formats:

  • MD5
  • SHA-1
  • SHA-256
  • SHA-512

By default, converted strings are converted to hex format and use UTF-8 encoding. To shorten the strings, select the Base 64 check box.

Hash MAC Text

Applies cryptographic hashing algorithms with Message Authentication signing to text strings. Provide a Hash MAC (Message Authentication Code) Key for an extra level of security.

By default, converted strings are converted to hex format and use UTF-8 encoding. To shorten the strings, select the Base 64 check box.

Index of Text

Returns the position of another string within the source string. The index is 0-based, so if the searched-for text is at the very beginning of the source, then the index is 0. If the string is not found, then the return value is -1.

Example:

  • Original token: Now is the winter of our discontent
  • Modifier: Index of Text (winter)
  • Result: 11
JSON Encode

Converts a string into a value that can be used as JSON.

Example:

  • Original token: some text "quoted text" other text slash \ more text

    newline

  • Modifier: JSON Encode
  • Result: "some text \"quoted text\" other text slash \\ more text\nnewline"
Last Word

Returns the last word in a string.

Example:

  • Original token: Now is the winter of our discontent
  • Modifier: Last Word
  • Result: discontent
Left

Shows the left X-most characters from the original token, where X=6 in the example below.

Spaces are included in the character count for this modifier.

Example:

  • Original token: Now is the winter of our discontent
  • Modifier: Left (6)
  • Result: Now is
Length of Text

Counts the number of characters in the string.

Spaces are included in the character count for this modifier.

Example:

  • Original token: Now is the winter of our discontent
  • Modifier: Length of Text
  • Result: 35
Lowercase

Converts any upper-case characters in the original token to lower-case.

Example:

  • Original token: Now IS The Winter Of Our Discontent
  • Modifier: Lower-case
  • Result: now is the winter of our discontent
Pad Left

Inserts a particular character(s) to the left of a value to force the value to be a particular length.

Example:

  • Original token: ABC
  • Modifier: Pad Left (0,7)
  • Result: 0000ABC
Pad Right

Inserts a particular character(s) to the right of a value to force the value to be a particular length.

Example:

  • Original token: ABC
  • Modifier: Pad Right (0,7)
  • Result: ABC0000
Remove

Removes a particular value from the original token.

Example:

  • Original token: Now is the winter of our discontent
  • Modifier: Remove (winter)
  • Result: Now is the of our discontent
Remove Line Breaks

Removes line breaks to make the token fit on a single line.

Example:

  • Original token: Now is the winter of our discontent,
  • Made glorious summer by this son of York.
  • Modifier: Remove line breaks
  • Result: Now is the winter of our discontent,Made glorious summer by this son of York.
Remove White Space

Removes any white space characters from the tokens: line breaks, spaces, tabs.

Example:

  • Original token: Now is the winter of our discontent
  • Modifier: Remove white-space
  • Result: Nowisthewinterofourdiscontent
Replace

Replaces one value in the string with another on every occurrence.

Example:

  • Original token: Now is the winter of our discontent
  • Modifier: Replace (winter, summer)
  • Result: Now is the summer of our discontent
Right

Shows the right X-most characters from the original token, where X=6 in the example below.

Spaces are included in the character count for this modifier.

Example:

  • Original token: Now is the winter of our discontent
  • Modifier: Right (6)
  • Result: ontent
Substring

Shows a certain number of characters from the middle of the token. The start position for a text string is considered to be 0, so Substring (0,6) is the equivalent of Left (6).

Spaces are included in the character count for this modifier.

Example:

  • Original token: Now is the winter of our discontent
  • Modifier: Substring (11,6)
  • Result: winter
Text After

Finds a value after a particular word or phrase inside of the token. There are several options to control how this modifier operates:

  • Next Word: Displays the next word after the search text.
  • Next Number: Displays the next number after the search text. This will skip over any text until it finds a number.
  • To End: Returns all of the text that appears after the text to search for.
  • To End of Line: Returns all of the text that appears after text to search for, up until the end of the line.

This modifier is often useful when parsing email messages.

Example:

  • Original token: This is regarding Incident: 1234 which is important
  • Modifier: Text After (Next Word, Incident: )
  • Result: 1234
  • Modifier: To End of Line (Next Word, Incident: )
  • Result: 1234 which is important
Text Before

Finds a value before a particular word or phrase inside of the token. There are several options to control how this modifier operates:

  • From Start: Returns the test that appears before the search text.
  • From Start of Line: Returns all of the text that appears before the search text, up until the end of the line.
  • Previous Word: Displays the next word before the search text.
  • Previous Number: Displays the next number before the search text.
Text Between

Returns all of the text that appears between two values in a token. This modifier is often useful when parsing email messages.

We recommend using the following markers:

  • ()
  • {}
  • *

Example:

  • Original token: Please enter a description between {Here} and {There}
  • Modifier: Text Between ({Here}, {There})
  • Result: and

We do not recommend using angle brackets (<>) as markers; the E-mail and Event Monitor reads HTML coding, and use of angle brackets as markers could cause unintended results.

Text to Logical

Converts a text value to a logical value. This is useful when reformatting a text value based on whether the text result is equal to True or False.

The values True, T, Yes, and 1 are converted to True. Any other values are converted to False.

Text to Number

Converts the value in a text token to a number. Numeric Modifiers can then be applied to the result. See Numeric Modifiers.

Example:

  • Original token: 12345
  • Modifier: Text to Number
  • Result: 12345 (now available for Numeric Modifiers)
Trim End

Trims specified characters from the end of a text string. Each character in the modifier is evaluated, regardless of order. Repeated characters are removed.

The following example shows how to trim end characters from a string:

  • Original token: 80906-1234
  • Modifier: Trim -1234
  • Results: 80906

The following example shows how to trim repeated characters from the end of a string:

  • Original token: 123400005
  • Modifier: Trim 05
  • Results: 1234

The following example shows how to trim characters from the end of a string, regardless of order:

  • Original token: abcergzxy
  • Modifier: Trim yxz
  • Results: abcerg

Trim Start

Trims specified characters from the start of a text string. Each character in the modifier is evaluated, regardless of order. Repeated characters are removed.

The following example shows how to trim start characters from a string:

  • Original token: 719-386-7000
  • Modifier: Trim 719-
  • Results: 386-7000

The following example shows how to trim repeated characters from the beginning of a string:

  • Original token: 000051234
  • Modifier: Trim 05
  • Results: 1234

The following example shows how to trim characters from the beginning of a string, regardless of order:

  • Original token: abcergzxy
  • Modifier: Trim cba
  • Results: ergzxy

Uppercase

Converts any lower-case characters in the original token to upper-case.

Example:

  • Original token: Now IS The Winter Of Our Discontent
  • Modifier: Upper-case
  • Result: NOW IS THE WINTER OF OUR DISCONTENT
Uppercase First

Converts only the first character to upper-case. This is often useful when working with names and proper nouns.

Example:

  • Original token: george
  • Modifier: Upper-case first
  • Result: George
URL Encode

Converts a string into a value that can be legally used as a URL.

Example:

  • Original token: This <is> a test
  • Modifier: URL Encode
  • Result: This%20&lt;is&gt;%20a%20test

Was this article useful?