Templating V2

Templating allows to insert content from an action or trigger output in another action fields. For example:

{{ step0:Body.supplierId }}

Templating V2 extends this concept to allow advanced transformation of data using the Liquid templating engine, removing the need for external services.

Breaking changes

With the new templating we make some breaking changes with the previous system:

Enabling Templating V2

The new templating system is enabled by default when creating a new flow. You can revert back to templating v1 in the "Preview Features" section of the flow Overview. Templating v1 will be considered deprecated, old flows will continue to use it unless they are migrated and new flows will use the new version by default.

⚠️ Be mindful that there are some breaking changes and your flow may stop working properly. Look at Breaking Changes section for more information.

  • Old references (using {{ stepX:x.x }}) will be invalidated, you have to manually change them to the new format.

Enable TemplatingV2

The Liquid templating language

The implemented templating language in Extension Kit tries to be compliant with the Liquid templating language, you can find more information about the language and features available in the Liquid official documentation.

Liquid filters support in Extension Kit

Filters change the output of a Liquid object. They are used within an output an separated by a |.

Some examples of different filters:

Here you will find a list of the supported filters, for more information, visit the Liquid documentation.

Supported: ✅ | Not supported: ❌ | Differs from Liquid documentation, check this documentation: ⚠️

Name Supported
abs
append
at_least
at_most
capitalize
ceil
date ✅/⚠️
default
divided_by
downcase
escape
escape_once
first
floor
join
last
lstrip
map
minus
modulo
newline_to_br
plus
prepend
remove
remove_first
replace
replace_first
reverse
round
rstrip
size
slice
sort
sort_natural
split
strip
strip_html
strip_newlines
times
truncate
truncatewords
uniq
upcase
url_decode
url_encode
where

Default flow variables

A flow has variables setup by default, those are:

Templating default variables

This can be extended with additional values provided by the team.

Additional functions

By default we include additional builtin functions attached to the different data types. To use them you will have to include the data type they belong to, for example:

Existing data types:

date

To use the date filter we must take into consideration a difference with the date filter provided in the Liquid documentation.

In Liquid, you can use date in the following way:

{{ step1.Body.publishedDate | date: "%a, %b %d, %y" }}

Instead, in Extension Kit, you must use the date.to_string <datetime> <pattern> <culture> filter.

Example: {{ step1.Body.publishedDate | date.to_string '%d %b %Y' }} or {{ date.now | date.to_string '%d %b %Y' }}.

Also, you can parse dates that come in a string format, for example: {{ date.parse '2016/01/05' }}. A full example of a parse plus a format could be:

{{ date.parse step0.Body.date | date.to_string '%a, %b %d, %y' }} where step0.Body.date equals '2020/10/10'. The result is Sat, Oct 10, 20.

There are a lot of additional functions you can use with the date object:

For more information and additional documentation, please visit the Date documentation.