@NormalizeSubject (JavaScript)

Normalizes empty and lengthy text.

Defined in

@Functions (Extension Library)

Syntax

@NormalizeSubject(subject:string) : string
@NormalizeSubject(subject:string, maxlength:int) : string
Table 1. Parameters
Parameter Description
subject:string The text to be normalized.
maxlength:int Maximum length of the text. Defaults to 80.
Table 2. Return value
Value Description
string The normalized text, or null if the parameter is null.

Usage

Text is normalized as follows:
  • Empty text is replaced by the word Untitled.
  • Text that exceeds the maximum length is truncated and appended by an ellipsis (...).

Examples

This computed field returns the normalized value of a requestScope variable.
return @NormalizeSubject(requestScope.subject, 32)