Phased rollout

 

This version of the software is currently available only to early adopter SaaS customers as the first step in our phased rollout.

Using functions to build custom expressions

 The following table describes functions that you can use to specify field values in various workflow actions.

FunctionArgumentsReturnDescription
DATE(timestamp)charReturns the date portion of the time stamp.
DATEADD(datepart, number, date)date

Adds a specified number of days, weeks, months, or years to the date and returns the new date. Specify datepart using one of the following quoted values:

  • Year—"year ", "yy ", or "yyyy "
  • Month—"month ", "mm ", or "m "
  • Day—"day ", "dd ", or "md "
  • Week—"week ", "wk ", or "ww "

The date parameter is the date value to add to. For example, to add 10 weeks to the 05/20/02 date, enter:

DATEADD("ww", 10, "05/20/08")
 DATEDIFF(datepart, startdate, enddate)int

Depending on the value of datepart (day or week), returns the number of days or weeks between the start date and the end date. Specify datepart using one of the following quoted values:

  • Day—"day ", "dd ", or "md "
  • Week—"week ", "wk ", or "ww "

For example, to find the number of days between date1 and date2, enter:

DATEDIFF("dd", $date1$, $date2$)
DATENAME(datepart, date)char

Depending on the value of datepart (month or weekday), returns the name of the month or the name of the day of the week corresponding to date. Specify datepart using one of the following quoted values:

  • Month—"month ", "mm ", or "m "
  • Weekday—"weekday " or "wd "

For example, to find the weekday for December 31, 2007, enter:DATENAME("wd", "12/31/07")

DATENUM(datepart, date)int

Depending on the value of datepart (year, month, week, day, or weekday), returns the numeric value of the year (4 digits), month (1 to 12), week (1 to 52), day (1 to 31), or weekday (1=Sunday, 2=Monday, and so on). Specify datepart using one of the following quoted values:

  • Year—"year ", "yy ", or "yyyy "
  • Month—"month ", "mm ", or "m "
  • Day—"day ", "dd ", or "md "
  • Week—"week ", "wk ", or "ww "
  • Weekday—"weekday " or "wd "

For example, DATENUM("mm", "12/31/07")returns 12.

DATEPARSE(Date date, String unit)intParses a date as per unit and returns a numeric value.
DAY(timestamp)intReturns the day of the time stamp (1 to 31).
HOUR(timestamp)intReturns the hour of the time stamp (0 to 23).
MINUTE(timestamp)intReturns the minute of the time stamp (0 to 59).
MONTH(timestamp)intReturns the month of the time stamp (1 to 12).
SECOND(timestamp)intReturns the seconds from the time stamp (0 to 59).
STRIPHTML(fieldID)charRemoves all formatting and image information from the contents of a rich-text-formatted field. The function returns a plain text string.
TIME(timestamp)charReturns the time portion of the time stamp.
WEEKDAY(timestamp)intReturns the weekday of the time stamp (1 to 7, where 1=Sunday and 7=Saturday).
YEAR(timestamp)intReturns the year portion of the time stamp.

HASHCODE

(String)

int

Returns the integer hash code of the string.

INDEXOF

(String value, Char character)

or

(String, String searchString)

int

Returns the index of the first occurrence of the specified character or string in an array.

LENGTH

(String value)

int

Returns the length of the string in an array.

LOWER

(String)

char

Converts the string to lowercase letters.

REPLACE

(String value, String target, String replacement)

char

Replaces each input string that matches the target sequence with the specified replacement sequence.

REPLACEALL

(String value, String regex, String replacement)

char

Replaces the input string value that matches the given regular expression with the replacement string.

SPLIT

(String, Char character)

or

(String, String regex)

char

Splits the string against given regular expression.

STARTSWITH

(String, int prefix)

boolean

Returns a Boolean value true or false based on whether the string begins with the specified letter or word.

SUBSTR or SUBSTRC

(String value, Int beginIndex)

or

(String value, Int beginIndex, Int endIndex)

char

Returns a new string that is a sub string of the specified string.

UPPER

(String)

char

Converts the string to uppercase letters.

Required licensing

SaaS subscribers who use BMC Helix ITSM or BMC Helix Virtual Agent Basic service are entitled to this feature.


Was this page helpful? Yes No Submitting... Thank you

Comments