MENU
    Full List of Expressions in the App Editor
    • 05 Aug 2024
    • 10 Minutes to read
    • Contributors

    Full List of Expressions in the App Editor


    Article summary

    This article contains the full list of expressions that are available to use in the App Editor within Trigger functions.

    Using expressions enables you to utilize your data in different ways or manipulate it into different forms.

    NOTE

    The list of expressions in the App Editor differs from the expressions available in the Analytics Editor.

    Available Expressions in the App Editor

    All examples are based on app Completions. So, when you use a MAXIMUM() or MINIMUM() function, for example, you are looking for the maximum or minimum value of a Variable across all completions of an app.

    ADD_TIME()
    Increments a Datetime value by a specified amount and interval unit.

    Ex. ADD_TIME(datetime_variable, 2, 'years')

    SUBTRACT_TIME()
    Decrements a Datetime value by a specified amount and interval unit.

    Ex. SUBTRACT_TIME(datetime_variable, 3, 'months')

    Typecasting Expressions

    DATETIMETOTEXT()
    Converts a Datetime value to a text value that is easily readable by a human

    Ex. DATETIMETOTEXT(datetime_variable, "MMMM DD, YYYY", 'America/New_York')

    This will convert a datetime to Eastern Standard Time and show it in traditional date formatting like "January 1, 2019".

    Note: The last parameter, the time zone, must come from one of the tz database names listed here.

    FILETOTEXT("url: File") => Text
    Converts File into a text string of the URL

    Ex: FILETOTEXT("http://www.africau.edu/images/default/sample.pdf")

    HEX_TO_INT()
    Return the numeric representation of a given hexadecimal string.
    Ex. HEX_TO_INT('0xAB18') = '43800'

    INT_TO_HEX()
    Return the hexadecimal representation of a given number.
    Ex. INT_TO_HEX('43800') = '0xAB18'

    INTERVAL_TO_SECONDS(interval: Interval) => Number
    Returns the length of an Interval in seconds

    EX. INTERVAL_TO_SECONDS(seconds_to_interval(30.0))

    LOWERCASE()
    Converts a string to all lowercase

    MAP_TO_BOOLEAN_LIST(a: {} array, b: text) => array
    Converts an Object Array to a base array for the given key

    Ex. MAP_TO_BOOLEAN_LIST([{key: value}], ‘key’) = [value]

    MAP_TO_INTEGER_LIST(a: {} array, b: text) => array
    Converts an object array to a base array for the given key

    Ex. MAP_TO_INTEGER_LIST([{key: value}], ‘key’) = [value]

    MAP_TO_NUMBER_LIST(a: {} array, b: text) => array
    Converts an object array to a base array for the given key

    Ex. MAP_TO_NUMBER_LIST([{key: value}], ‘key’) = [value]

    MAP_TO_TEXT_LIST(a: {} array, b: text) => array
    Converts an object array to a base array for the given key

    Ex. MAP_TO_TEXT_LIST([{key: value}], ‘key’) = [value]

    SECONDS_TO_INTERVAL()
    Converts seconds into an Interval.

    SECONDS_TO_INTERVAL(seconds: Integer or Number) => Interval

    Ex. SECONDS_TO_INTERVAL(20) => 0:00:20

    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.

    Ex. TEXTTOBOOLEAN("yes")

    TEXTTODATETIME()
    Converts a text value into a Datetime value with the specified parameters. Commonly used if you have a Connector Function that shares a Datetime in text format and you need to convert it.

    TEXTTOIMAGEURL(url:Text) => Image URL
    Converts a string to an image URL.

    EX. TEXTTOIMAGEURL("https://example.com/photo.jpg")

    TEXTTOINTEGER()
    Parses text or Interval into an Integer.

    Ex. TEXTTOINTEGER("123")

    TEXTTONUMBER()
    Parses text or timestamp into a Number

    Ex. TEXTTONUMBER("2.4")

    TOTEXT()
    Parses anything into text.

    Ex. TOTEXT(2)

    UPPERCASE()
    Converts a string to all uppercase

    USER_ID_TO_USER(id: Text) => User
    Converts a user id to a user object

    Ex. User_id_to_user("abc") = User

    Truncated Expressions

    CEIL()
    Rounds up to the nearest Integer

    FLOOR()
    Rounds down to the nearest Integer

    ROUND()
    Rounds a number to the specified number of decimal places. Maximum of 3 decimal places.
    Ex. 1 - ROUND(123.123456, 1)
    This will return 123.1
    Ex. 2 - ROUND(123.12)
    This will return 123

    ROUNDDATETIME()
    Truncates a Datetime value to a given unit, like month or day.

    Ex. ROUNDDATETIME(datetime_variable, "Month", "America/New_York")
    This will convert a datetime to just the month in Eastern Standard Time.

    Note: The last parameter, the time zone, must come from one of the tz database names listed here.

    Value Return Expressions

    ABS()
    Return the absolute value of a number

    CONTAINS()
    Returns whether a string contains a given substring
    Ex. CONTAINS("123ABC", "123")
    This would return "true"

    COS()
    Returns the cosine of the given input

    ENCODE_URI(component: Text) => Text
    Returns a URL-encoded string version of a URI.
    Ex. ENCODE_URI("http://example.com/a=foo&b=a test") = "http://example.com/a=foo&b=a test"

    ENCODE_URI_COMPONENT(component: Text) => Text
    Returns a URL-encoded string version of a URI component.

    EX. ENCODE_URI_COMPONENT("a & b") = "a%20%26%20b"

    FIND()
    Returns the position for where the first argument occurs within the second argument.

    IF()
    Based on the first argument, returns the second argument if first argument is true, or third argument if first argument is false.
    Ex. IF(true, 1, 2)

    ISNULL()
    Returns true if the argument is null, otherwise false.

    LEFT()
    Returns a substring of a text value, beginning at the position specified by the second argument.

    LEN()
    Returns the length of a text value.

    LINK()
    Returns the first of the arguments that is not null.

    Ex. LINK(weight, 70)
    This will return the value of weight if weight has a value

    MAX()
    Returns the argument with the highest value
    Ex. MAX(var1, var2)
    This will return the value of var1 if it is greater than the value of var2

    MID()
    Returns a substring of a text value, starting at the position specified by the second argument. The third argument specifies the length of the return.

    MIN()
    Returns the argument with the lowest value
    Ex. MIN(var1, var2)
    This will return the value of var1 if it is less than the value of var2

    POW()
    Return the first argument raised to the second argument
    Ex. POW(3,2)
    This will return 9

    RAND()
    Generates a random decimal number between 0 and 1

    RANDBETWEEN()
    Generates a random integer between two specified numbers
    Ex. RANDBETWEEN(5,10)

    RANDOMSTRING()
    Returns a random 17-character string. Meant for creating an ID for a new Table record.

    RANDOM_COLOR()
    Generates a random color

    Ex. RANDOM_COLOR() = ##c537a5

    RGA(r: Integer, g:Integer, b:Integer, a:Integer) => Color
    Returns a color of the specified red, green, blue and alpha components

    Ex. RGA(255, 255, 0, 0.5) = ##ffff00 (50% opacity)

    RGB(r: Integer, g:Integer, b:Integer) => Color
    Returns a color of the specified red, green, and blue components

    Ex. RGB(255, 255, 0) = ##ffff00

    RIGHT()
    Returns a substring of a text value, ending at the position specified by the second argument.

    SIN()
    Returns the sine of the given input

    SPLIT()
    Splits a text value into an Array by a specified delimiter.

    SQRT()
    Return the square root of a number

    SUBSTITUTE()
    Within a string given in the first argument, replace all examples of the second argument with the third argument
    Ex. SUBSTITUTE("A734", "7", "3")
    This will return "A334"

    TAN()
    Returns the tangent of the given input

    TRIM()
    Removes a substring (specified by the second argument) from the front and back of the first argument.

    Array Expressions

    ARRAY_AVG()
    Returns the average of all numbers in an array
    Ex. ARRAY_AVG([1,2,3])
    This would return 2

    ARRAY_CONCAT()
    Returns a single array with all elements from the arrays included in the arguments. Only works with arrays of the same type ie all text arrays.
    Ex. ARRAY_CONCAT([1,2],[3,4],[5,6])
    This would return [1,2,3,4,5,6]

    ARRAYCONTAINS()
    Determine if a value is in an Array
    Ex. ARRAYCONTAINS([1,2,3], 1)
    This will return "true"

    ARRAY_MAX()
    Returns the minimum from a given array
    Ex. ARRAY_MAX([1,2,3])
    This would return 3

    ARRAY_MIN()
    Returns the minimum from a given array
    Ex. ARRAY_MIN([1,2,3])
    This would return 1

    ARRAY_STDEV_POPULATION()
    Returns the standard deviation of the population of a given numeric array
    Ex. ARRAY_STDEV_POPULATION([1,2,3])
    This would return 0.816496580927726

    ARRAY_STDEV_SAMPLE()
    Returns the standard deviation of the sample of a given numeric array
    Ex. ARRAY_STDEV_SAMPLE([1,2,3])
    This would return 1

    REGEX_MATCH()
    Returns an array of regular expression matches of a text value. Matches based on the given regular Expression and modifiers. This method is based on the match JavaScript method and has 2 "modes".

    When this method is given 2 arguments, it is equivalent to the following JavaScript expression:

    text.match(new RegExp(regex))
    Plain text

    When the optional parameter modifiers is provided, this method is equivalent to the following expression in JavaScript:

    text.match(new RegExp(regex, modifiers))
    Plain text

    Modifiers are flags that can be used to modify the behavior of the regex search.

    REGEX_REPLACE()
    Returns an array of regular expression matches of a text value. Matches based on the given regular Expression and modifiers. This method is based on the replace JavaScript method.

    When the function is given 3 arguments, it is equivalent to the following JavaScript expression:

    text.replace(new RegExp(regex), replacement)
    Plain text

    .
    When the optional parameter modifiers is provided, this method is equivalent to the following expression in JavaScript:

    text.replace(new RegExp(regex, modifiers), replacement)
    Plain text

    Modifiers are flags that can be used to modify the behavior of the regex search.


    Did you find what you were looking for?

    You can also head to community.tulip.co to post your question or see if others have faced a similar question!


    Was this article helpful?