Expressions are predefined calculations that take inputs matching a data type and return outputs matching a data type.
Expressions in Tulip differ from expressions as a general concept because they utilize specific Tulip data types, such as a user.
Their syntax (the way they are created) resemble functions from Microsoft Excel.
Expressions are used in the following Models:
Expressions are defined locally - they exist within the Trigger or Analysis where they are defined.
An expression can be in one of two states:
An example expression to convert a string to lowercase:
| Name | Description | Inputs | Output |
|---|---|---|---|
| ABS | Returns the absolute value of the input | n: Number | float |
| ADD_TIME | Add a duration of time (e.g. days, weeks) to a Datetime. | a: Datetime, b: Number, c: string | Datetime |
| ARRAYCONTAINS | Returns true if the given value is in the given array, false otherwise | array: Array, v: Integer, Number, Text or Boolean | |
| ARRAY_AVG | Returns the average of a given numeric array | a: Array | |
| ARRAY_CONCAT | Concatenates any number of arrays of a single type into a single array of that type | ||
| ARRAY_INDEX_OF | Return the index of a value for a given array. When the value occurs more than once, the first index will be returned. | a: array, b: string | integer |
| ARRAY_MAX | Returns the maximum of a given numeric array | a: Array | |
| ARRAY_MIN | Returns the minimum of a given numeric array | a: Array | |
| ARRAY_STDEV_POPULATION | Returns the standard deviation of the population of a given numeric array | a: Array | |
| ARRAY_STDEV_SAMPLE | Returns the standard deviation of the sample of a given numeric array | a: Array | |
| AVERAGE | Returns the average of its argument | n: Integer or Number | |
| AVERAGEFILTERED | Returns the average of its argument, filtered to completions matching the given condition | n: Integer or Number, condition: Boolean | |
| AVG | Returns the average of its argument | n: Integer or Number | |
| AVGFILTERED | Returns the average of its argument, filtered to completions matching the given condition | n: Integer or Number, condition: Boolean | |
| BADGE_ID_TO_USER | Converts a badge id to a user object | badgeID: Text | user |
| CEIL | Rounds up to the nearest integer | n: Integer or Number | |
| CONTAINS | Returns whether or not a string contains a given substring | string: Text, substring: Text | boolean |
| COS | Returns the cosine of the given input in radians | n: Number | float |
| COUNT | Returns the number of completions matching the given condition | condition?: Boolean | |
| COUNTOFCOMPLETIONS | Returns the total number of completions. | ||
| ROUNDDATETIME | Truncates a date to the given unit | date: Datetime or Date, truncation: Text, timezone (optional): Text | |
| ENCODE_URI | Returns a URL-encoded string version of a URI. | component: Text | string |
| ENCODE_URI_COMPONENT | Returns a URL-encoded string version of a URI component. | component: Text | string |
| FILETOTEXT | Convert from a File type to a Text string. *Behind the fileInTables feature flag | a: file | string |
| FIND | Finds the starting index of the given substring inside the given string | find: Text, within: Text | integer |
| FLOOR | Rounds down to the nearest integer | n: Integer or Number | |
| DATETIMETOTEXT | Formats a date to a string. Formatting: | date: Datetime or Date, format: Text, timezone: Text | |
| HEX_TO_INT | Returns the numeric representation of the given hexadecimal string | hex: Text | float |
| IF | Returns the second argument if the first argument is true, or the third argument if the first argument is false | condition: Boolean, valueIfTrue: T, valueIfFalse: T | |
| INTERVAL_TO_SECONDS | Returns the length of an interval in seconds | interval: Interval | float |
| INT_TO_HEX | Returns the hexadecimal representation of the given number | n: Number | string |
| ISEMPTY | Returns True when an array does not contain values | a: Array | boolean |
| ISNULL | Returns True if the value is NULL | a: any data type | boolean |
| LEFT | Returns a substring containing n characters starting from the left | text: Text, n: Integer | string |
| LEN | Returns the length of the input string | text: Text | integer |
| LINK | Returns the first non-null argument. Takes any number of same-type arguments. | ||
| LOWERCASE | Converts string to be all lowercase | s: Text | string |
| MAP_TO_BOOLEAN_LIST | Converts an object array to base array for the given key | ||
| MAP_TO_INTEGER_LIST | Converts an object array to base array for the given key | ||
| MAP_TO_NUMBER_LIST | Converts an object array to base array for the given key | ||
| MAP_TO_TEXT_LIST | Converts an object array to base array for the given key | ||
| MAX | Returns the maximum of the given values | a: Number, b: Number | float |
| MAXFILTERED | Returns the maximum of its argument, filtered to completions matching the given condition | n: Integer or Number, condition: Boolean | |
| MAXIMUM | Returns the maximum of its argument | n: Integer or Number | |
| MAXIMUMFILTERED | Returns the maximum of its argument, filtered to completions matching the given condition | n: Integer or Number, condition: Boolean | |
| MID | Returns a substring containing n characters starting from start | text: Text, start: Integer, n: Integer | string |
| MIN | Returns the minimum of the given values | a: Number, b: Number | float |
| MINFILTERED | Returns the minimum of its argument, filtered to completions matching the given condition | n: Integer or Number, condition: Boolean | |
| MINIMUM | Returns the minimum of its argument | n: Integer or Number | |
| MINIMUMFILTERED | Returns the minimum of its argument, filtered to completions matching the given condition | n: Integer or Number, condition: Boolean | |
| NULLIF | Returns null if the first argument equals the second argument, otherwise returns the first argument | ||
| TEXTTODATETIME | Parses a datetime from text and format. Formatting: | datetime: Text, format: Text, timezone (optional): Text | |
| TEXTTOFILE | Parse a text url of a file to a Tulip File Type. *Behind the fileInTables feature flag | a: text | file |
| POW | Returns the first argument raised to power of the second argument | base: Number, exponent: Number | float |
| RAND | Generates a random decimal number between 0 and 1 | float | |
| RANDBETWEEN | Generates a random number between (and including) the two numbers provided | minimum: Integer, maximum: Integer | integer |
| RANDOMSTRING | Returns a random 17-character string | string | |
| RANDOM_COLOR | Generates a random color | ||
| REGEX_MATCH | Returns an array of matches to the regular expression | ||
| REGEX_REPLACE | Converts a string to a new string by characters that match a REGEX pattern | source: string, regex: string, replace: string, modifiers: string | string |
| RGB | Returns a color of the specified red, green, and blue components | r: Integer, g: Integer, b: Integer | color |
| RGBA | Returns a color of the specified red, green, blue, and alpha components | r: Integer, g: Integer, b: Integer, a: Number | color |
| RIGHT | Returns a substring containing n characters starting from the right | text: Text, n: Integer | string |
| ROUND | Rounds a number to the specified number of digits, or the nearest integer if no digits provided | n: Integer or Number, d?: Integer | |
| SECONDS_TO_INTERVAL | Converts seconds into an interval | seconds: Integer or Number | interval |
| SIN | Returns the sine of the given input in radians | n: Number | float |
| SPLIT | Splits text on the given delimiter | ||
| SQRT | Returns the square root of a number | n: Number | float |
| TEXTTOIMAGEURL | Converts a string into an image URL | url: Text | imageUrl |
| SUBSTITUTE | Replaces text from given string with another string | s: Text, e: Text, n: Text | string |
| SUBTRACT_TIME | Subtract a duration of time (e.g. days, weeks) from a Datetime. | a: Datetime, b: Number, c: string | Datetime |
| SUM | Returns the sum of its argument | n: Integer or Number | |
| SUMFILTERED | Returns the sum of its argument, filtered to completions matching the given condition | n: Integer or Number, condition: Boolean | |
| TAN | Returns the tangent value of the input in radians | n: Number | float |
| TEXTTOBOOLEAN | Parses text into a boolean. “y”, “yes”, “t”, “true”, and “on” (and any capitalized variants) are recognized as true, and “n”, “no”, “f”, “false”, and “off” are recognized as false | n: Text | |
| TEXTTOINTEGER | Parses text into a integer | n: Text | |
| TEXTTONUMBER | Parses text or a timestamp into a number | n: Text | |
| TOTEXT | Parses anything into text | n: any | |
| TRIM | Trims the given character(s) from the ends of the given string | text: Text, chars?: Text | string |
| UPPERCASE | Converts string to be all uppercase | s: Text | string |
| USER_ID_TO_USER | Converts a user id to a user object | id: Text | user |
| ID | Name |
|---|---|
| QA-T497 | Expression Editor : 01 - Create an expression in an app trigger |
| QA-T521 | Expression Editor : 02 - Running the "Expressions" app |
| ID | Requirement |
|---|---|
| PLAT-8799 (75) | Ability to send notifications from any content screen. Ie. email, txt message, alarms. |
| PLAT-8887 (190) | Ability to define a UoM and the conversion formulas and rules between UoMs |