Stay organized with collections
Save and categorize content based on your preferences.
In addition to the
standard library modules,
Workflows supports a number of other built-in helper functions
such as for data type and format conversions.
Accepts an attribute of type map and returns a list of key elements in
the map.
len()
Computes the length of a value according to its type. Accepts an
attribute of type list, map, or string and returns an integer.
A list returns the number of elements in the list.
A map returns the number of key-value entries
stored in the map.
A string returns the number of characters in the
string.
Conditional functions
Support conditions within expressions.
Functions
default(val, defaultVal)
Returns a value if it is not null; otherwise returns a default
value.
If not null, val is returned.
If val is null, defaultVal
is returned.
You can use default with the standard library function,
map.get,
to safely access optional values in a map, returning null if the key is
not found. For an example, see
Read map
values.
You can also use default to access optional runtime
arguments, and return a default value if the key is not found. For an
example, see
Access runtime arguments.
if(condition, ifTrue, ifFalse)
Evaluates a condition and returns one of two arguments depending
on what the condition evaluates to.
If condition evaluates to true, ifTrue
is returned.
If condition evaluates to false or null,
ifFalse is returned.
Note that arguments passed to if are always evaluated
and that the function does not control processing flow. To
conditionally execute an expression, use a switch
statement. For more information, see
Conditions.
Type functions
Return data type.
Functions
get_type(arg)
Returns a string indicating the data type of arg:
one of boolean, bytes, double,
integer, list, map,
string, or null.
If the operand is a function or a subworkflow,
a TypeError is raised.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-30 UTC."],[],[]]