# Double Braces functions

You can use Double Braces functions to manipulate data in a pipeline.

## Syntax

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.

### Nesting functions

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.

#### Example

**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"
}
```

## Function list

Below, we have listed Double Braces functions by groups based on their usage.

### COMPARISON <a href="#comparison" id="comparison"></a>

Used to compare booleans inputs. To learn more, read the article [Comparison Functions](/documentation/connectors-and-triggers/double-braces/double-braces-functions/comparison-functions.md):

* AND
* NOT
* OR
* XOR

### NUMERICAL <a href="#numerical" id="numerical"></a>

Used to manipulate numeric values. To learn more, read the article [Numerical Functions](/documentation/connectors-and-triggers/double-braces/double-braces-functions/numerical-functions.md):

* FORMATNUMBER
* TODOUBLE
* TOINT
* TOLONG
* TONUMBER
* RANDOMNUMBERS

### CONDITIONAL <a href="#conditional" id="conditional"></a>

The functions in this group return a value according to a specified criteria. To learn more, read the article [Conditional Functions](/documentation/connectors-and-triggers/double-braces/double-braces-functions/conditional-functions.md):

* EQUALTO
* GREATERTHAN
* GREATERTHANEQUAL
* IF
* LESSTHAN
* LESSTHANEQUAL
* ISOBJECT
* ISARRAY
* ISBOOLEAN
* ISSTRING
* ISNUMBER
* ISNULL
* SWITCHCASE
* ISABSENT

### DATE <a href="#date" id="date"></a>

Used to manipulate dates. To learn more, read the article [Date Functions](/documentation/connectors-and-triggers/double-braces/double-braces-functions/date-functions.md):

* FORMATDATE
* NOW
* SUMDATE
* TOISODATE
* DIFFDATE

### FILE <a href="#file" id="file"></a>

Used to query metadata and validate files. To learn more, read the article [Comparison Functions](/documentation/connectors-and-triggers/double-braces/double-braces-functions/comparison-functions.md):

* FILEEXISTS
* FILESIZE

### JSON <a href="#json" id="json"></a>

Used to manipulate JSON objects. To learn more, read the article [JSON Functions](/documentation/connectors-and-triggers/double-braces/double-braces-functions/json-functions.md):

* JSONPATH
* TOJSON
* UNESCAPEJSON
* GETELEMENTAT
* LASTELEMENT
* REMOVEAT
* NEWEMPTYOBJECT
* NEWEMPTYARRAY
* PUSH
* POP
* CARDINALITYONE
* CARDINALITYMANY

### MATH <a href="#math" id="math"></a>

Used to make mathematical operations. To learn more, read the article [Math Functions](/documentation/connectors-and-triggers/double-braces/double-braces-functions/math-functions.md):

* ABS
* CEIL
* DIVIDE
* LOG
* MAX
* MIN
* MOD
* MULTIPLY
* POW
* ROUND
* SQRT
* SUBTRACT
* SUM

### STRING <a href="#string" id="string"></a>

Used to manipulate strings. To learn more, read the article [String Functions](/documentation/connectors-and-triggers/double-braces/double-braces-functions/string-functions.md):

* CAPITALIZE
* CONCAT
* CONCATWITHOUTTAB
* ESCAPE
* FUZZYMATCH
* INDEXOF
* JOIN
* LASTINDEXOF
* LEFTPAD
* LOWERCASE
* MATCHES
* NORMALIZE
* REPLACE
* RIGHTPAD
* SPLIT
* SUBSTRING
* TOSTRING
* UPPERCASE
* CONTAINS
* DEFAULT
* UNESCAPE
* TRIM
* STRINGMATCHES
* RANDOMSTRINGS

### UTILITIES <a href="#utilities" id="utilities"></a>

Used to make operations that do not fit the other categories. To learn more, read the article [Utilities Functions](/documentation/connectors-and-triggers/double-braces/double-braces-functions/utilities-functions.md):

* BASEDECODE
* BASEENCODE
* UUID
* TOBOOLEAN
* SIZE
* BASEURLDECODE
* BASEURLENCODE
* URIDECODE
* URIENCOD


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digibee.com/documentation/connectors-and-triggers/double-braces/double-braces-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
