Functions
The following table describes functions that you can use to specify field values in these workflow actions:
- Open Window
- Push Fields
- Service
- Set Fields
All functions listed in the following table work with active links, filters, and escalations, with the following exceptions:
- The HOVER, LISTGET, LISTSIZE, MAPGET, TEMPLATE, and VISIBLEROWS functions work only in active links.
- The ENCRYPT, DECRYPT, and STRIPHTML functions work only in filters and escalations.
Functions
Function | Arguments | Return | Description |
---|---|---|---|
DROPPEDROWINDEX | (field ID) | int | For a row on which a drop event occurs on a list view, tree view, or cell-based table field,returns the 1-based row index of the row for the most recent drop operation. |
DROPPEDCOLUMNINDEX | (field ID) | int | For a column on a drop event occurs on a list view, tree view, or cell-based table field, returns the 1-based column index of the column for the most recent drop operation. |
COLAVG | (column) | any (matches column) | For a given column on a list view, tree view, or results list table field, returns the average of all non-NULL row values as a real type. Exceptions:
|
COLCOUNT | (column) or (table) | int | For a list view, tree view, or results list table field, returns the total number of rows. For a column field, returns the total number of non-NULL rows in a given column. |
COLMAX | (column) | any (matches column) | For a given column on a list view, tree view, or results list table field, returns the maximum value of the row values. |
COLMIN | (column) | any (matches column) | For a given column on a list view, tree view, or results list table field, returns the minimum value of the row values. |
COLSUM | (column) | any (matches column) | For a given column on a list view, tree view, or results list table field, returns the sum of all values as a real type. Exceptions:
|
CURRCONVERT | (currency, type, timestamp) | For a given currency, converts currency to a different type according to new date, and recalculates the functional currency values. Use syntax such as:
Use other values for the type and timestamp, such as a character field and a date field, for example:
For information about data conversion rules for currency fields, see Workflow considerations for currency fields. This function is not supported in a progressive view. | |
CURRSETDATE | (currency, timestamp) | For a given currency, sets a new date of currency and recalculates the functional currency values. Use syntax such as:
Use other values for the timestamp, such as a date field or integer. For example:
For information about data conversion rules for currency fields, see Workflow considerations for currency fields. This function is not supported in a progressive view. | |
CURRSETTYPE | (currency, type) | For a given currency, sets new type of currency and recalculates the functional currency values. Use syntax such as:
Use other values for the type, such as a character field. For example:
For information about data conversion rules for currency fields, see Workflow considerations for currency fields. This function is not supported in a progressive view. | |
CURRSETVALUE | (currency, value) | For a given currency, sets new value of currency and recalculates the functional currency values. Use syntax such as:
Use another field to set the currency value, such as a decimal field. For example:
For information about data conversion rules for currency fields, see Workflow considerations for currency fields. This function is not supported in a progressive view. | |
DATE | (timestamp) | char | For a given date, 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. |
DAY | (timestamp) | int | Returns the day of the time stamp (1 to 31). |
DECRYPT | (ciphertext, key) | Used in Set Fields filter and escalation actions only. Returns the unencrypted text value of the encrypted text (cyphertext), using the encryption key (key). The return value is smaller than the size of the encrypted string. When decrypting, you must use the same key that you used when encrypting. For example, to decrypt the string in Field1 using the key my_key, enter:
To decrypt a string using a key in KeyField, enter:
Use this function with character fields only. See information about the Encrypted String field in Reserved fields. | |
ENCRYPT | (plaintext, key) | Used in Set Fields filter and escalation actions only. Returns the encrypted value of a text string (plaintext), using the encryption key (key). The return value is larger than the size of the unencrypted string. For example, to encrypt the string in Field1 using the key my_key, enter:
To encrypt a string using a key in KeyField, enter:
Use this function with character fields only. See information about the Encrypted String field in Reserved fields. For more information about the algorithm used for encryption, see Workflow-Encryption-Algorithm. | |
GETSURVEYSTATUS | (survey field ID) | int | Use this function while creating a survey questionnaire. This function returns the status depending on whether all questions are answered or not.
|
HOUR | (timestamp) | int | Returns the hour of the time stamp (0 to 23). |
HOVER | (column) | char | For a column in a list view, tree view, a results list table field, or a cell-based table, the string value of the column in the row being hovered over is returned. For a table itself, the row number of the hovered over row is returned. For a given attachment pool, a string value containing the file name (if any) of the hovered attachment is returned. For example, to get the HOVER value for a table column with ID 536880913, enter:
When the field being referenced for the HOVER function is not being hovered over, an empty string is returned. This function should be used in conjunction with an On Hover active link execution option. |
ISTABLESELECTALLCHECKED | (field ID) | Boolean | In a progressive view, depending on whether you select the check box to select all records in a list-view table, this function returns the following values:
To learn about the Bulk Select Label property in Developer Studio that you must use along with this function, see Field Properties. |
JSONMAP | (value, string) | string | Use this function to extract specific values from JSON data.
Where Example: JSONMAP($jSONFieldID$, $expressionField$) In this function, |
LEFT | (string, number) | char | Use this function when the value of the Length Units property of a field is bytes. |
LEFTC | (string, int) | string | Use this function when the value of the Length Units property of a field is characters. Returns the left-most characters of the first parameter up to the number of characters indicated by the second parameter. |
LENGTH | (char) | int | Use this function when the value of the Length Units property of a field is bytes. |
LENGTHC | (string) | int | Use this function when the value of the Length Units property of a field is characters. |
LISTGET | (fieldid, index) | string | Returns the value from the list that is maintained by a character field, at the indicated position. If the range of the index is not between 1 and LISTSIZE(), this function returns NULL. For example, if character field 1234 contains the value abc;def;ghi;jkl, calling LISTGET(1234,2) returns the value def. |
LISTSIZE | (fieldid) | int | Returns the number of entries in a list or map that is maintained by a character field. If the value is NULL, the function returns 0. For example, if character field 1234 contains the value abc;def;ghi;jkl, calling LISTSIZE(1234) returns the value 4. |
LOWER | (char) | char | Returns all characters in the string (char) as lowercase characters. No conversion is performed to double-byte characters. |
LPADC | (string, number, padCharacter) | char | Use this function when the Length Units property of a field is characters. For example, if you want the results of a Set Fields operation to be a 15-character value with the prefix LEAD, followed by zeros, and ending in the contents of the integer field Call #, enter:
If the Call # field contains the number 947, the result of the Set Fields action is LEAD00000000947. |
LTRIM | (char) | char | Returns the value of (char) after deleting any blank space and tabs to the left. |
MAPGET | (field ID, key) | int, string | Returns a value from a map that is present within a character field. If the key does not have a value, this function returns NULL. For example, if character field 1234 contains the value type=4;Name=""John Smith"";operation=""="";status=Open, calling MAPGET(1234,"Name") returns the value John Smith. You can use double-quotes to escape the value containing space or delimiters. |
MAX | (any,any[,any]..) | any (matches input) | Returns the maximum value of the set specified. The data type of all values must match for the result to be meaningful. For example, to check the current time and the escalation time, and return the greater (latest) value of the two, enter:
MAX returns $NULL$ only if all arguments in the function evaluate to $NULL$. |
MIN | (any,any[,any]..) | any (matches input) | Returns the minimum value of the specified set. The data type of all values must match for the result to be meaningful. For example, to check the current time and the escalation time, and return the lower (earliest) value of the two, enter:
If any argument evaluates to $NULL$, the argument is not considered in the evaluation of the function. For example, if MyField is empty (has a value of $NULL$ ), but the field HasValue has a value of 10, then MIN($MyField$, $HasValue$) returns 10. MIN returns $NULL$ only if all arguments in the function evaluate to $NULL$. |
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). |
REPLACE | (char,char,char) | char | Returns the value that results from replacing any occurrences of the second parameter (char) found in the first parameter (char) with the contents of the third parameter (char). For example, to replace the name Bob with the name Robert, enter:
To replace all occurrences of the double-quote character (") within a character string with another character, for example, replacing any instance of a double quote with the name Robert, enter:
As a result, anywhere a double quote is found in the Submitter field, the double quote is replaced with the name Robert. |
RIGHTC | (string, number) | char | Use this function when the Length Units property of a field is characters. Returns the right-most characters of the first parameter (char) up to the number of characters indicated by the second parameter (int). For example, to set the value of a field to the last four characters of an account code, enter:
|
ROUND | (real), (decimal), or (currency) | int or currency | Returns the rounded value of a real number or a complex data type. For a decimal value, for example, 5.1 to 5.4 are rounded to 5, and 5.5 to 5.9 are rounded to 6. For a currency value, for example, 5.01 USD through 5.49 USD are rounded to 5.00 USD, and 5.50 USD through 5.99 USD are rounded to 6.00 USD. |
RPADC | (string, number, padCharacter) | char | Use this function when the value of the Length Units property of a field is characters. For example, to add blank spaces after a submitter's name to make the entry 20 characters long, enter:
|
RTRIM | (char) | char | Returns the value of (char) after deleting any blank space and tabs to the right. |
SECOND | (timestamp) | int | Returns the seconds from the time stamp (0 to 59). |
SELECTEDROWCOUNT | (tableid) | int | For tree view tables, it returns the number of leaf nodes represented by the selected node. If a node does not contain a leaf node, this function returns 1. For list view tables, it returns the number of selected rows. For cell-based tables, it returns the number of selected cells. |
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. See Adding rich-text-formatting capabilities to a character field. |
STRSTR | (char, char) | int | Use this function when the value of the Length Units property of a field is bytes. |
STRSTRC | (string, findchar) | int | Use this function when the value of the Length Units property of a field is characters. |
SUBSTR | (char, int, int) | char | Use this function when the value of the Length Units property of a field is bytes. If the third parameter is not included, the function returns characters to the end of the string. If the third parameter is less than the second parameter, the function returns a NULL value. |
SUBSTRC | (string, int, int) | string | Use this function when the value of the Length Units property of a field is characters. Returns the substring of characters in the first parameter starting at the position indicated by the second parameter and continues to the position indicated by the third parameter. If the third parameter is not included, the function returns characters to the end of the string. If the third parameter is less than the second parameter, the function returns a NULL value. The string is zero-indexed. |
TEMPLATE | (char,char,char,...) | char | Returns a string from the specified template formatted with values substituted for template parameters. The first parameter is the template name. The template parameters and their values follow in pairs, for example:
|
TIME | (timestamp) | char | Returns the time portion of the time stamp. |
TRUNC | (real), (decimal), or (currency) | int or currency | Returns the truncated value of a real number or a complex data type. For a decimal value, for example, 5.1 through 5.9 are truncated to 5. For a currency value, for example, 5.01 USD through 5.99 USD are truncated to 5.00 USD. |
UPPER | (char) | char | Returns all characters in the string (char) as uppercase characters. No conversion is performed to double-byte characters. This function does not support the Capital Sharp S (ß) character in an active link. |
VISIBLEROWS | (int) | int | Returns the number of rows currently visible. The value does not include any deleted rows in the visible range. If no records are displayed or the table is not chunked, the function returns a value of 0. If the table ID is invalid, the function returns a NULL value. |
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. |
Comments
Log in or register to comment.