Skip to main content
Skip table of contents

Template Expressions

What are Template Expressions?

Template Expressions are used to insert dynamic data into your export files. It even allows you to perform actions to your data using predefined functions.

Expressions only recognize text between {{}} or {%%} as expression code. Anything not surrounded by those tags is treated as-is.

GL Processor Cloud uses a derivative of the Liquid template language. You can read a more in-depth introduction to the Liquid template language here.

Objects and Fields

Liquid evaluates and replaces any text inside {{ and }}.

For example, if you want to insert the value from the Amount field, you could write the following expression:

Template

Output

{{ export[“Amount”] }}

125.99

Filters and Functions

Functions or methods in other languages are referred to as filters in liquid. Filters can be used for a variety of things, such as converting a string to uppercase, formatting a date, performing math computations, and lots more.

Filters are called by adding a pipe character | between the field and the filter. For example,

Input

Template

Output

01/31/25

{{ export[“Date”] | format(“yyyy-MM-dd”) }}

2025-01-31

500.55

{{ 0 | minus: export["Credit"] }}

-500.55

01-1100-111

{{ export[“GL Account”] | split: “-” last }}

111

Whitespaces

When writing expressions, whitespace is generally preserved outside of the curly braces. by contrast, any whitespace contained between {{ and }} is generally ignored.

In the following table, the · symbol will represent an invisible space character.

Template

Output

·{{·message·}}··

·Hello··

{{····message·|·downcase··}}

hello

····{{message}}

····Hello

msg = ·{{·message·}}·

{"msg": "·Hello·"}

These examples show that anything outside of {{...}} is preserved, which can potentially add unwanted whitespace to your data.

Conditional Operators

Conditional operators evaluate and replaces any text inside {% and %}.

For example, if you wanted to evaluate a property value and use different outputs based on the evaluation you could write:

Input

Template

Output

Credit

{% if export["Type"] == "Debit" %}
D
{% else %}
C
{% endif %}

C

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.