Expression Editor Functions
You can use the following functions in the Expression Editor to build expressions:
Function | Description | Return Type | Example | Error Condition |
|---|---|---|---|---|
| Returns the absolute value of the input value. | Numeric | abs(-5) returns | Input cannot be converted to a numerical value. |
| Returns the inverse cosine of the input value. The result is an angle between 0 and pi. | Numeric | acos(true) returns | Input cannot be converted to a numerical value. |
| Appends a set of values to a list and returns the new list. | List | append(emptylist,"1",2,3.333) returns a list with | If the first parameter is not a list or if any value parameter is list or map. |
| Returns the inverse sine of the input value. The result is an angle between 0 and pi. | Numeric | asin(-1) returns | Input cannot be converted to a numerical value. |
| Returns the inverse tangent of the input value. The result is an angle between 0 and pi. | Numeric | atan(-1) returns | Input cannot be converted to a numerical value. |
| Returns the average of multiple values. | Numeric | average(3, true, 4, 0, 2, 1, 1, 1, 1, 6) returns | Input cannot be converted to a numerical value. |
| Decodes the input string using the Base64 decoding algorithm. | String | base64decode("YQ==") returns | Input is not a Base64 string. |
| Encodes the input string using the Base64 encoding algorithm. | String | base64encode("a") returns | Input cannot be converted to a string value. |
| Converts the Boolean value to a string. | String | booleantostring(5) returns true | Input cannot be converted to a Boolean value. |
| Rounds the input value up to the next largest integer. | Numeric | ceiling(5) returns | Input cannot be converted to a numerical value. |
| Checks if a key is in the map. If the key exists in the map, it returns | Boolean | containskey(emptymap, "Foo") returns | The first parameter is not a map. |
| Checks if a value is in the map. If the value exists in the map, it returns | Boolean | containsvalue(emptymap, 1.234) returns | The first parameter is not a map. |
| Returns the date in the given time zone. | DateTime | Assume the server is in the EST time zone: converttimezone("2000-01-01T00:00:00", "PST") returns | The |
| Converts the input date, which is in the | DateTime | converttimezone2("2000-01-01T00:00:00", "EST", "PST") returns | The date parameter is not a valid date and time. Invalid time zone IDs are reverted to GMT. |
| Converts the input value, which is in the The This function evaluates at runtime only. | Numeric | convertunits(25.4, "mm", "inch") returns 1 | Input cannot be converted to a numerical value.
|
| Returns the cosine of the input. | Numeric | cos(5) returns | Input cannot be converted to a numerical value. |
| Returns the hyperbolic cosine of the input. | Numeric | cosh(5) returns | Input cannot be converted to a numerical value. |
| Adds days to the | DateTime | dateadddays("2003-07-25T04:00:00", 7) returns |
|
| Adds hours to the |
| dateaddhours("2000-01-01T00:00:00", 5) returns |
|
| Adds minutes to the | DateTime | dateaddminutes("2000-01-01T00:00:00", 5) returns |
|
| Adds months to the | DateTime | dateaddmonths("2000-01-01T00:00:00", 5) returns |
|
| Adds seconds to the | DateTime | dateaddseconds("2000-01-01T00:00:00", 5) returns |
|
| Adds years to the | DateTime | dateaddyears("2000-01-01T00:00:00", 5) returns |
|
| Determines whether the If the | Boolean | datebetween("2000-01-01T01:00:00","2000-01-01T00:00:00", "2000-01-01T02:00:00") returns true | Inputs cannot be converted to valid date values. |
| Returns an integer that identifies which date is older. If | Numeric | datecompare("2000-01-01T00:00:00", "2000-01-01T00:00:01") returns | Inputs cannot be converted to valid date values. |
| Returns the number of milliseconds between two dates. | Numeric | datediff("2000-01-02T01:00:00","2000-01-01T00:00:00") returns | Inputs cannot be converted to valid date values. |
| Returns the number of days between two date values. | Numeric | datediffdays("2000-01-02T01:00:00","2000-01-01T00:00:00") returns | Inputs cannot be converted to valid date values. |
| Returns the number of days between two date values. | Numeric | datediffdaysdstaware("2000-01-02T01:00:00","2000-01-01T00:00:00") returns | Inputs cannot be converted to valid date values. |
| Returns the number of hours between two date values. | Numeric | datediffhours("2000-01-01T00:00:00", "2000-01-01T01:00:00") returns | Inputs cannot be converted to valid date values. |
| Returns the number of minutes between two date values. | Numeric | datediffminutes("2000-01-01T00:00:00", "2000-01-01T01:00:00") returns 60 | Inputs cannot be converted to valid date values. |
| Converts the | String | dateformat("2000-01-30 5:00:00", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd") returns | The |
| Converts the | String | On a server running in CET time zone dateformattz("2000-01-30 5:00:00", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "UTC") returns | The |
| Converts the XML | String | On a server running in CET time zone datefromxmlformattz("2003-07-01T04:00:00", "MM-dd-yyyy HH:mm:ss", "UTC") returns | Date cannot be converted to a valid |
| Gets the date from the input value, which is the number of seconds since January 1 0001 00:00:00 UTC. | DateTime | datefromseconds(60) returns | Input cannot be converted to valid numeric value. |
| Gets the date from the | String | datefromseconds("60", "HH:mm") returns 00:01 |
|
| Converts the XML datetime value to the specified datetime format. | String | datefromxmlformat("2003-07-01T04:00:00", "MM-dd-yyyy HH:mm:ss") returns |
|
| Converts the specified | DateTime | datefromseconds("0001-01-01T00:01:00") returns 60 | Input cannot be converted to valid numeric value. |
| Converts the | DateTime | datetoxmlformat("01-30-2000 05:00:00", "MM-dd-yyyy HH:mm:ss") returns | The input |
| Converts the | DateTime | On a server running in CET time zone datetoxmlformattz("01-30-2000 05:00:00", "MM-dd-yyyy HH:mm:ss", "UTC") returns | The input |
| Returns the day of the month from the | Numeric | day("06-21-2003 04:00:00") returns | Input cannot be converted to valid DateTime value. |
| Returns the day of the week from the | Numeric | dayofweek("2000-01-02T05:30:00") returns 1 | Input cannot be converted to valid DateTime value. |
| Returns the day of the year ( | Numeric | dayofyear("2000-02-02T05:30:00") returns 33 | Input cannot be converted to valid DateTime value. |
| Returns the number of days in the month from the | Numeric | daysinmonth("2000-02-02T05:30:00") returns 29 | Input cannot be converted to valid DateTime value. |
| Decodes the input using the Base64 decoding algorithm. |
| decode("YQ==") returns a | Input is not a string value or a valid Base64 string. |
| Returns the difference in offset values from | Numeric | Difftimezone("PST", "EST") returns | Parameters cannot be converted to string values and are not valid time zones. |
| Returns the daylight savings offset, relative to the standard offset, for a time zone. | Numeric | Dstoffset("EST") returns | The |
| Encodes the input using the Base64 encoding algorithm. | String | encode("a") returns YQ== | Input cannot be converted to a valid string value. |
| Returns a string specifying This function complements the action of the log function and is referred to as the antilogarithm. | Numeric | exp(5) returns | Input cannot be converted to a valid numerical value. |
| Returns the index of the first occurrence of the value, or if the value is not found, it returns | Numeric | find(emptylist,"Foo") returns -1 | The first parameter is not a list. |
| Returns the first element in the list. | Any noncollection type | If | The parameter is not a list or the list does not contain elements. |
| Rounds the value to the next smallest integer. | Numeric | floor(5.99) returns 5 | Input cannot be converted to a valid numerical value. |
| Returns the value in the string format. | String | format(1, "0.000") returns | The |
| Formats the current time into the input format. | String | If the server is in the Eastern Standard time zone, formatdatenow("zzz") returns EST | Format is not valid. |
| Returns the value used to convert a unit of measure to another unit of measure. The This function evaluates at runtime only. | Numeric | getconversionfactor("m", "mm") returns 1000 | The |
| Returns all XPath nodes from the document in a list. | List | getlistfromxpath(Transaction.Document, "//item") returns a list with all <item> elements in the | The first parameter is not a document or the XPath statement is malformed. |
| Returns all XPath nodes from the document in a map. If | Map | getmapfromxpath(Transaction.Document, "//item*", false) returns a map with all <item> elements children elements in the | The first parameter is not a document or the XPath statement is malformed. |
| Returns the offset for a time zone from GMT. If daylight savings should be included in the calculations, set the | Numeric | getoffset("EST", false) returns | The |
| Returns the value of the specified session variable. | VariantData | getsessionvariable("path") returns the path for the transaction | The name parameter holds an invalid value |
| Returns the value of a property by value name. | Any | getvalue("Transaction.Value") returns the | The name does not exist in the properties. |
| Returns the hour of the specified | Numeric | hour("2000-01-02T05:30:00") returns 5 | The input cannot be converted to a valid DateTime value. |
| If the | Numeric | if(true, 1, 2) returns 1 | The input |
| Returns true if the input date is during daylight savings. | Boolean | indst("2000-01-01T00:00:00") returns | The date parameter must be a valid time. |
| Returns a new list with the input list parameter updated to have the value inserted in the specified location. | List | insert(emptylist, 0, "Foo") returns a list with the value | The first parameter is not a list or the location is not valid. |
| Returns a list of all key values in the map. | List | keys(Transaction.Map) returns the list of all keys in the | The parameter is not a map. |
| Returns the last element in the list. | Any noncollection type | If the | The parameter is not a list or the list does not contain elements. |
| Returns a list from the parameters. Valid parameters are of any primitive type and list. In the case of a list, the entries from the parameter are appended to the resulting list. | List | list(1,2,3,"4") returns a list of integers | The input parameters are collections (lists or maps). |
| Converts the list into a string using the specified delimiter. | String | listtostring(timezoneids, ", ") returns the available time zone IDs delimited by a comma and a space. | The first parameter is not a list or the second parameter is not a string. |
| Returns a map with each name in the | Map | liststomap(Transaction.NamesList, Transaction.ValuesList) returns a map with the | The parameters are not lists, the parameters are not the same size, or the lists are empty. |
| Returns the natural logarithm of the value. | Numeric | ln(5) returns | The input value cannot be converted to a valid numerical value. |
| Converts | String | localformat(5, "0.0") returns 5.0 | The input |
| Returns the localized text for the input key. If no localized text exists, the system returns the input key. | String | You defined the following localized values:
| If a localized value is not defined for a locale, the key (in this example, |
| Converts the specified string to a numerical value using the local server's regional settings. | Numeric | localnumber(5) returns 5.0 | The input cannot be converted to a valid numerical value. |
| Returns the Base10 logarithm of the specified value. | Numeric | log(5) returns | The input cannot be converted to a valid numerical value. |
| Returns the log base of the value. | Numeric | logn(5, 3) returns | The inputs cannot be converted to valid numerical values. |
| Returns a map from the input parameters. The parameters can be a map or two parameter sets, where the first parameter is a name and the second is a value. | Map | map("one",1,"two",2) returns a map with two elements, where the first element is named one with a value of 1 and the second element is named two with a value of 2 | The input parameters are collections (lists or maps). |
| Indicates whether a match is found in the specified string. The function uses the regular expression specified in the | Boolean | match("Foo", "Foo") returns true | The input |
| Indicates whether a match is found in the specified string. The function uses the regular expression specified in the | Boolean | Match2("Foo", "foo") returns false | The input |
| Returns the largest of the input values. | Numeric | max(3, true, 4, 0, 2, 1, 1, 1, 1, 6) returns 6 | The inputs cannot be converted to numerical values. |
| Returns the smallest of input values. | Numeric | max(3, true, 4, 0, 2, 1, 1, 1, 1, 6) returns 0 | The inputs cannot be converted to numerical values. |
| Returns the minute value from the specified | Numeric | minute("2000-01-02T05:30:00") returns 30 | The input cannot be converted to a valid DateTime value. |
| Returns the month from the specified | Numeric | month("2000-01-02T05:30:00") returns 1 | The input cannot be converted to a valid DateTime value. |
| Returns the date for the first day of the next month. | DateTime | monthend("2000-01-02T05:30:00") returns | The input cannot be converted to a valid DateTime value. |
| Returns the date for the first day of the month. | DateTime | monthstart("2000-01-02T05:30:00") returns | The input cannot be converted to a valid DateTime value. |
| Returns the logical negation of the Boolean value. If the Boolean value is | Any | not(true) returns 0 | The input cannot be converted to a valid Boolean value. |
| Converts the specified string to a numerical value. | Numeric | number(5) returns 5.0 | The input cannot be converted to a valid numerical value. |
| Returns a new map with the input map parameter updated with the value set to the specific key. | Map | put(Transaction.Map, "Foo", 99) returns the | The first parameter is not a map. |
| Returns a random number in the specified range. You must enter positive | Numeric | random(2,30)returns | The inputs cannot be converted to valid numerical values. |
| Returns a random value based on the specified percentage. Values less than or equal to zero return | Boolean | If you enter | The |
| Returns a new collection with the value parameter removed. If the collection is a list, the value is an index. If the collection is a map, the value is a key. | Map or list | remove(Transaction.List, 2) returns the | The first parameter is not a collection or the value is not valid for the collection. |
| Rounds the input value to the nearest integer. | Numeric | round(5.99) returns 6 | The input value cannot be converted to a valid numerical value. |
| Returns a round value for the maximum value. | Numeric | scaledmax(0.2, 9.6) returns | The input values cannot be converted to valid numerical values. |
| Returns a round value for the minimum value. | Numeric | scaledmin(0.2, 9.6) returns | The input values cannot be converted to valid numerical values. |
| Returns the value, which was originally scaled based on the You can use this function for animation. | Numeric | scaledvalue(5, 0, 10, 0, 100) returns | The input values cannot be converted to valid numerical values. |
| Returns the seconds from the specified | Numeric | second("2000-01-02T05:30:00") returns | The input value cannot be converted to a valid DateTime value. |
| Returns a new list with the input list parameter updated with the value set in the specified location. | List | set(Transaction.List, 5, "Foo") returns the | The first parameter is not a list or the location is not valid. |
| Returns the sine of the specified value. | Numeric | sin(5) returns | The input value cannot be converted to a valid numerical value. |
| Returns the hyperbolic sine of the value. | Numeric | sinh(5) returns | The input value cannot be converted to a valid numerical value. |
| Returns the size of the collection. | Numeric | size(Transaction.Map) returns the number of items in the | The parameter is not a collection. |
| Returns the list sorted. | List | sort(Transaction.UnsortedList) returns the | The parameter is not a list. |
| Returns the square root of the specified value. You must enter a value that is greater than or equal to zero. | Numeric | sqrt(5) returns | The input value cannot be converted to a valid numerical value. |
| If the | String | stringif(true, 1, 2) returns | The input value cannot be converted to a valid Boolean value. |
| Finds the pattern in the string and returns its starting index. | Numeric | stringindexof("football", "ball") returns | The inputs cannot be converted to valid string values or the |
| Returns a substring of the specified string, which represents the number of characters ( | String | stringleft("football", 3) returns | The input string cannot be converted to a valid string value or the |
| Returns the length of the string. | Numeric | stringlength("football") returns | The input cannot be converted to a valid string value. |
| Returns a lowercase version of the string. | String | stringlower("FOOTBALL") returns | The input cannot be converted to a valid string value. |
| Returns the substring of length | String | stringpart("Football", 3, 2) returns | The input |
| Tests the string value against the | String | stringreplace("Football", o, u) returns | The input parameters cannot be converted to valid string values. |
| Returns a substring of the string, which represents the number of characters ( | String | stringleft("football", 3) returns | The input string cannot be converted to a valid string value or the |
| Converts a string value to a Boolean value. | Boolean | stringtoboolean("1") returns | The input string cannot be converted to a valid Boolean string value. |
| Removes white space from both sides of the string. | String | stringtrim(" football ") returns | The input cannot be converted to a valid string value. |
| Returns the string in all capital letters. | String | stringupper("Football") returns | The input cannot be converted to a valid string value. |
| Returns the index within the value string of the last occurrence of the search string. | Numeric | stringlastindexof("123123", "3") returns | - |
| Returns the tangent of the input. | Numeric | tan(5) returns - | The input cannot be converted to a valid numerical value. |
| Returns the hyperbolic tangent of the input. | Numeric | tanh(5) returns | The input cannot be converted to a valid numerical value. |
| Returns a unique file name with an extension. | String | tempfile(5) returns | The input cannot be converted to a valid numerical value. |
| Returns a list of all values in the map. | List | values(Transaction.Map) returns a list of all values in the | The parameter is not a map. |
| Decodes the input string as if it was an XML-encoded string. | String | xmldecode("a & b") returns | The input is not a string value. |
| Encodes the input string to comply with XML standards. The function converts the following characters to their XML equivalents:
| String | xmlencode(If A > B then...) returns | The input string cannot be converted to a valid string value. |
| Encodes the input string as the XML node name. | String | encode(35) returns | The input string cannot be converted to a valid string value. |
| Returns the year from the | Numeric | year("2000-01-02T05:30:00") returns 2000. | The input cannot be converted to a valid DateTime value. |
| Returns the date of the first day of the first month of the year after the year specified in the | DateTime | yearend("2000-01-02T05:30:00") returns | The input cannot be converted to a valid DateTime value. |
| Returns the date of the first day of the first month of the year specified in the | DateTime | yearstart("2000-01-02T05:30:00") returns | The input cannot be converted to a valid DateTime value. |
| Converts the | List | stringtolist(“john/james/mary”, ”/”) returns [[String :John],[String:james],[String:mary]] | The input |
| Checks the | String | stringreplaceall(“original Foobar”, “o”, “U”) returns Uriginal FUUbar | The input |
| Gets the value from the map by providing the map and the key as the parameter. | List | getValue(Name=[String:john], ”Name”) returns John | The input |
| ||||
| ||||
|