JMESPath
Both admin UI and runners have custom functions added to standard JMESPath library
The following functions can be used in addition to specification provided by JMESPath language, to support common use cases:
Implementation Domain
Server Side
These functions are available wherever JMESPath expressions are used by runners (e.g. transform steps, input/output patterns).
Client Side
These functions are available in conditional display, eval value widget, table editor pattern cells as well as name & icon field definitions of listers. They are not supported in other JMESPath use cases.
Batch
These functions are available wherever JMESPath expressions are used by Python runners and libraries (e.g. ML training steps, python event handlers).
Customization on the client side includes async functions, which are not applicable for certain use cases, which is why these functions are not used in all UI elements.
Some functions are only available on batch, client or server side, which are marked as follows:
[C]: Available on Client-Side.
[S]: Available on Server-Side.
[B]: Available on Batch.
Unmarked: Available on all.
Server-side JMESPath implementation returns null when the input node is null, regardless of the expression provided (including constant value expressions), due to Java JMESPath library implementation logic.
This applies to all areas where JMESPath is used (i.e. transform steps, event input and output patterns).
Functions
add_all(array, array) [S,B]
Merges contents of two arrays provided and returns them as a new array.
atob(string) [S,B]
Decodes a given base64 string and returns it as a UTF-8 string.
btoa(any) [S,B]
Encodes a given value into a base64 string.
cartesian(array) [S,B]
Creates the cartesian product of an array of arrays provided.
compare(any, any) [S]
Performs a comparison between the first and second parameters and returns 0 (if equal), -1 if (first < second) or 1 (if first > second) as the result.
cond(boolean, any, any) [S,C]
If a given condition value is true, returns the first given parameter, otherwise returns the second given parameter.
cron(string, string, string, number) [S]
A versatile function, processing given cron pattern, followed by an action, using the given time zone for a given epochMs time. Actions supported are as follows:
last: Returns epoch ms for the last time this cron pattern was applicable before given time.
next: Returns epoch ms for the next time this cron pattern willbe applicable after given time.
fromLast: Returns ms from last time this cron pattern was applicable before given time.
toNext: Returns ms to next time this cron pattern willbe applicable after given time.
match: Returns whether the pattern matches given time.
If time zone is null or "SYSTEM", server time zone is used for the pattern evaluation.
date_to_string(number, string="MM-dd-yyyy")
Converts a date given in epoch milliseconds into a string using the given Java date format.
decode_url(string) [S]
Decodes a string which is in encoded URL form.
decrypt(string, string, string = "AES/ECB/PKCS5Padding", string = "AES") [S]
Decrypts a given encrypted string using a given key string. Two optional parameters are used for specifying the algorithm and key algorithm.
Please note that "AES/ECB/PKCS5Padding" is not the recommended algorithm for operations requiring high level of security and should be replaced with the preferred secure encryption algorithm.
deep_merge(...object)
Deep merges all given (nested) objects. For shallow merges standard merge() function can be used instead.
distinct(array) [S]
Returns distinct list of values inside an array.
divide(number, number)
Divides a given number by another given number. Returns null if the divisor is 0.
dynamic(any, string) [S]
Executes a dynamic jmespath expression given as string on a given parameter.
dynamic_repeat(any, array, string) [S]
Executes a dynamic jmespath expression using each entry of a given array as "entry" and a given parameter as "input" to produce a new array.
dynamic_filter(any, array, string) [S]
Executes a dynamic jmespath expression that returns boolean for filtering a given array using each entry of that array as "entry" and a given parameter as "input".
element_at(array, number) [S]
Returns element of a given array at given index, supporting variable index access to arrays.
encode_url(string) [S]
Encodes a string into encoded URL form.
encrypt(string, string, string="AES/ECB/PKCS5Padding", string="AES") [S]
Encrypts a given plain string using a given key string. Two optional parameters are used for specifying the algorithm and key algorithm.
Please note that "AES/ECB/PKCS5Padding" is not the recommended algorithm for operations requiring high level of security and should be replaced with the preferred secure encryption algorithm.
For encrypting/decrypting more complex contents, to_json/from_json functions can be used.
from_json(any) [S]
Converts a json object/array into string.
get_element(object, string) [S,C]
Returns element from a given json object using a given json path string.
group_by(array, string) [S]
Groups entries of a given array by a given field and returns grouped results in [{id:"", list:[]}] form.
guid() [S]
Creates and returns a glbally unique ID string.
hash(string, string, string="SHA-256", number=1) [S]
Hashes given plain string using a given key string. Two optional parameters are used for specifying the algorithm and hash iteration count.
index_array(array, string="field", number=0)
Adds an index field to all entries of a given array, using given string as field name and starting index value from given number.
intersect(array, array) [S]
Finds intersection of entries in given two arrays.
k_vtoo(string, any) [S]
Converts a given key string and value entry to an object.
lookup(array, array, string, boolean=false) [S,B]
Joins two arrays with a key string field and returns them as a new array. If last parameter is true, a full join is performed instead of left join.
lookup(string, string) [C]
Performs a lookup from a given source for a given id string.
Client side lookup function is only available within evaluation providers (i.e. not available with Handlebars templates) due to specific nature of async access.
Not implemented on server side to avoid unintended access to sensitive states on a runner.
ltoo(array, string) [S,B]
Converts a list of key-value pairs in a provided array into an object using key string field.
merge_index(array, array, string=null, string=null)
Merges two given arrays on index of their entries. If field names are given as 3rd and 4th parameters, entry contents are nested under these fields, otherwise they are merged with spreaded fields.
minus(number)
Returns negative of a given number.
mod(number, number)
Returns modulo of a given number using another given number as base.
multiply(number, number)
Multiplies two given numbers.
now()
Returns current time in epoch milliseconds.
otol(object, string, string) [S,B]
Converts an object to list of key-value pairs using a key string field and value string field.
power(number, number)
Returns power of a given number using another given number as base.
rand(number, number) [S]
Returns a random integer between given two numbers.
regex(string, string) [C,B]
Returns matched contents of a string with a given regex expression string.
remove_all(array, array) [S,B]
Removes all entries of the second array from the first array.
remove_elements(object, array) [S]
Removes all fields of a given object that are listed in a given string array.
remove_nulls(object) [S]
Removes fields with null values from a given object.
repeat(object, array, string) [S,B]
Repeats a given object for each element of a given array with array elements merged as a key string field.
replace(string, string, string)
Replaces occurences of the 2nd string with the 3rd string within the 1st string.
salt_key(number) [S]
Creates a secure random key with given number of characters.
set_element(object, string, any)
Adds/sets the value of a given object at the given string path.
slug(string, boolean=false) [S,B]
Converts a given string into a slug, with option to use transliteration. Trims the string, converts to lower case, transliterates or normalizes, removes non-ascii letters, replaces non-alphanumeric characters with hyphen, removes leading & trailing hyphens.
split(string, string)
Splits a given string with a given delimiter string.
string_to_date(string, string="MM-dd-yyyy")
Converts a date given as a string in the given Java date format into epoch time in milliseconds.
substr(string, number, number=null)
Returns substring of a given string with a given start index and an optional end index.
to_int(number) [S]
Returns the integer part of the number. Similar to floor function, but returns an int value instead of double.
to_json(string) [S]
Converts a string into a json object/array.
to_lower(string) [S]
Converts a string into lower case.
to_upper(string) [S]
Converts a string into a upper case.
trim(string) [S]
Returns trimmed version of a given string.
type(any) [S]
Returns type of the input parameter (OBJECT, ARRAY, NUMBER, STRING, BOOLEAN or NULL).
uuid() [S]
Creates a universally unique ID value.
validate_hash(string, string, string, string="SHA-256", number=1) [S]
Compares given plain string with a hashed string, using a given key string. Two optional parameters are used for specifying the algorithm and hash iteration count.
Last updated