Expression syntax quick reference

This quick reference provides a list of all functions, operators, and special variables in the expression syntax. For complete descriptions, see this topic: Expression syntax for advanced triggers and actions.

Functions

cat(knowledge_base_name,n)
Extracts the name of a category in a knowledge base according to the rank of the category in the match results. n is a number that represents the rank of the category, with 1 being the highest rank. This function returns a string that represents the name of the category, or an empty string if no name is found.
date('yyyy-MM-dd HH:mm:ss.S')
Converts a string in canonical date format into a structure that can be used for arithmetic calculations and comparisons.
date('now')
The date and time is taken from the system at run time.
date($content_field)
The date in canonical format is extracted from a content field.
export_date(date_structure,'date_format')
Exports the date in any ICU format, specified by the date_format parameter.
import_date($content_field,'date_format')
Extracts the date from a content field in the format that is specified by the date_format parameter.
Start of change join($content_field, <joiner_string>) End of change
Start of change Joins the parts of a multivalue content field into a single string. The second parameter specifies the separator between the parts. End of change
period('time_period') or period($content_field)
Converts a time period into seconds. The time period must be in this format: days hours:minutes:seconds
score('knowledge_base_name',category_name)
Extracts the score of the specified category score from a knowledge base match operation. This function returns a number between 0-1. The function returns 0 if no score is found.
score('knowledge_base_name',n)
Extracts the nth score from a knowledge base match operation. n is a number that represents the order of relevancy with 1 being the highest score. This function returns a number between 0 - 1. The function returns 0 if no score is found.
score(threshold_file_name,category_name)
Extracts a category's threshold from the specified threshold file that lists one threshold per category. This function returns a number between 0 - 1. The function returns 0 if no score is found.
size($content_field_name)
Extracts the number of values in a multivalue content field. If the content field is single value, the function returns 0 if the field is empty, or otherwise returns 1. If the content field does not exist, the function returns 0.
split($content_field_name,'delimiter')
Splits a content field into several parts based on the specified delimiter.
strlen($content_field_name)
Returns the number of characters in a content field. The function returns 0 when the specified content field is empty or does not exist.
substring(string,position,length)
Extracts a substring from a string or content field. This function returns a string of the specified length that starts at the specified position in the string (indexed from 1). If the specified position is not correct, the function returns an empty string. If the specified length is larger than what is available, the function extracts a substring from the specified position until the end of the string.

Operators

:
Finds words, phrases, or a combination of words and phrases within a content field. This operator returns true if they are found.
contains
Finds a substring in a content field. This operator returns true if the substring is found.
contains_field
Finds a content field or temporary variable in a content field (case sensitive). This operator returns true if the substring is found.
contains_lowcase_field
Finds a content field or temporary variable in a content field (not case sensitive). This operator returns true if the substring is found.
is
Compares two strings or content fields. The comparison is case sensitive. The operator returns true if the two strings or content field values are the same.
is_lowcase
Compares two strings or content fields. The comparison is not case sensitive. The operator returns true if the two strings or content field values are the same.
exists
Returns true when a content field exists in a content item.
if (A) then (B) else (C)
Evaluates the first expression A. If expression A is true, the second expression B is returned. Otherwise, the third expression C is returned. The second and third expressions must be the same type.
=, <>, >, <, >=, <=
Compares numbers. Each operator returns a Boolean value.
+, -, *, /
Numeric operators. Each operator returns a number.
'A' concat $B
Concatenates strings and content fields that contain strings.
or (in a Boolean condition)
Returns true if either operand is true.
or (in a word search)
Returns a union of the word locations that are found for the two operands.
and (in a Boolean condition)
Returns true if both operands are true.
and (in a word search)
Returns true if both words are found.
not (in a Boolean condition)
Returns true if the operand is false, or returns false if the operand is true.
not (in a word search)
Returns true if the word was not found, or returns false if the word was found.
d/n, d/s, s/n, s/s distance operators (in a word search)
Based on the word locations that are found for the two operands, returns all word locations that are within the specified distance.

Special variables

Start of change var[temporary_variable_name] End of change
Start of change Extracts a value from a predefined temporary variable. The variable is deleted after the document is evaluated. End of change
Start of change var[NULL] is predefined as an empty string. End of change
counter[counter_name]
Extracts a numeric value from the specified counter in the decision plan environment. This global counter is deleted when the server stops or can be configured to be reset at midnight.
stringlist[file_name]
Specifies a list of search strings to be imported from an external text file.
wordlist[file_name]
Specifies a list of search words or phrases to be imported from an external text file.