Double Braces Functions
Know what the functions associated with the Double Braces are and how to use them.
You can use Double Braces functions to manipulate data in a pipeline.
Double Braces functions are enclosed within two sets of curly braces and a blank space, with the function name followed by a list of parameters enclosed in parentheses, like this:
{{ FUNCTIONNAME(param1, param2) }}
Double Braces functions are case-insensitive, but we recommend writing them in upper case as a best practice.
You can use Double Braces function calls inside other functions, like this:
{{ OUTSIDEFUNCTION(INSIDEFUNCTION(param1,param2), param3) }}
When you do this, the functions are executed from the inside to the outside. That is, in the example above,
INSIDEFUNCTION
is executed first and its output is used as a parameter for OUTSIDEFUNCTION
, which is executed last.Unlike programming languages, Double Braces expressions executes all functions at the same moment, regardless of whether the IF condition is
true
or false
. This differs from programming languages, which usually execute functions only after checking the IF condition.Input
{
"date": "2022-10-26T03:00:00Z"
}
Double Braces expression
{
"format": {{ IF(EQUALTO(SIZE(message.date),20),FORMATDATE( message.date, "yyyy-MM-dd'T'HH:mm:ss'Z'", "dd/MM/yyyy"),FORMATDATE( message.date, "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", "dd/MM/yyyy")) }}
}
Output
{
"success": false,
"message": "Encountered a configuration error while generating JSON",
"error": "com.digibee.pipelineengine.exception.PipelineEngineConfigurationException: com.digibee.doublebraces.service.DoubleBracesConfigurationException: Syntax error parsing double braces expression {{ IF(EQUALTO(SIZE(message.date),20),FORMATDATE( message.date, \"yyyy-MM-dd'T'HH:mm:ss'Z'\", \"dd/MM/yyyy\"),FORMATDATE( message.date, \"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\", \"dd/MM/yyyy\")) }}: Could not parse date/time evaluating function FORMATDATE. Error: Text '2022-10-26T03:00:00Z' could not be parsed at index 19"
}
Below, we have listed Double Braces functions by groups based on their usage.
- AND
- NOT
- OR
- XOR
- FORMATNUMBER
- TODOUBLE
- TOINT
- TOLONG
The functions in this group return a value according to a specified criteria. To learn more, read the article Conditional Functions:
- EQUALTO
- GREATERTHAN
- GREATERTHANEQUAL
- IF
- LESSTHAN
- LESSTHANEQUAL
- ISOBJECT
- ISARRAY
- ISBOOLEAN
- ISSTRING
- ISNUMBER
- ISNULL
- SWITCHCASE
- FORMATDATE
- NOW
- SUMDATE
- TOISODATE
- DIFFDATE
- FILEEXISTS
- FILESIZE
- JSONPATH
- TOJSON
- UNESCAPEJSON
- GETELEMENTAT
- LASTELEMENT
- REMOVEAT
- ARRAYTOOBJECT
- OBJECTTOARRAY
- NEWEMPTYOBJECT
- NEWEMPTYARRAY
- ABS
- CEIL
- DIVIDE
- LOG
- MAX
- MIN
- MOD
- MULTIPLY
- POW
- ROUND
- SQRT
- SUBTRACT
- SUM
- CAPITALIZE
- CONCAT
- ESCAPE
- INDEXOF
- JOIN
- LASTINDEXOF
- LEFTPAD
- LOWERCASE
- MATCHES
- NORMALIZE
- REPLACE
- RIGHTPAD
- SPLIT
- SUBSTRING
- TOSTRING
- UPPERCASE
- CONTAINS
Used to make operations that do not fit the other categories. To learn more, read the article Utilities Functions:
- BASEDECODE
- BASEENCODE
- UUID
- TOBOOLEAN
- SIZE
Last modified 1mo ago