Using functions to build custom expressions
When creating process workflows, you can use a variety of functions in workflow actions.
The following table describes functions that you can use to specify field values in various workflow actions.
Function | Arguments | Return | Description |
---|---|---|---|
DATE | (timestamp) | char | Returns 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:
The date parameter is the date value to add to. For example, to add 10 weeks to the 05/20/02 date, enter:
|
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:
For example, to find the number of days between date1 and date2, enter:
|
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:
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:
For example, DATENUM("mm", "12/31/07")returns 12. |
DATEPARSE | (Date date, String unit) | int | Parses a date as per unit and returns a numeric value. |
DAY | (timestamp) | int | Returns the day of the time stamp (1 to 31). |
HOUR | (timestamp) | int | Returns the hour of the time stamp (0 to 23). |
MINUTE | (timestamp) | int | Returns the minute of the time stamp (0 to 59). |
MONTH | (timestamp) | int | Returns the month of the time stamp (1 to 12). |
SECOND | (timestamp) | int | Returns the seconds from the time stamp (0 to 59). |
STRIPHTML | (fieldID) | char | Removes all formatting and image information from the contents of a rich-text-formatted field. The function returns a plain text string. |
TIME | (timestamp) | char | Returns the time portion of the time stamp. |
WEEKDAY | (timestamp) | int | Returns the weekday of the time stamp (1 to 7, where 1=Sunday and 7=Saturday). |
YEAR | (timestamp) | int | Returns 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. The SPLIT function works in the same way as the Java String split function “String[] java.lang.String.split(String regex)”. It returns a String array as the output. You can use a multi-instance loop of process to iterate through each item. |
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. |
Comments
Log in or register to comment.