Last updated: 05 January 2022

Data comes in all shapes and sizes.

Whether it is a date from an external software sent as DDMMYYYY or a token hidden away behind a query string, when you need to access these data points, you need them in the right format.

Formatters allow you to do just that.

Everywhere you can use variables, you have a choice to use formatters to transform a value hidden inside a variable from one format to another.

Below, we dive into each formatter and illustrate them with use cases.

Date formatter

The date formatter allows you to convert any supported date-time format into a format of your choice.

What is the use case?

Imagine you are creating a chatbot capable of booking meetings using our date picker. Our date picker uses the following date format: dd-mm-yyyy.

This is all well and good. But, if you need to send this date to an external software (a CRM, for example), they might require a yyyy-mm-dd date format.

This is where the date formatter comes in.

As you enter your variable inside the integration, use the formatter to convert the original format (dd-mm-yyyy) into the new one.

The date formatter supports the following date-time parameter strings:






Day of the month with leading zeros

01 to 31


Three letter name of the day.



Day of the month without leading zeros.

1 to 31

l (lowercase 'L')

Complete name of the day.

Sunday through Saturday


Numeric representation of the day of the week, starting at 1 for Monday.

1 for Monday, 3 for Wednesday, etc.


English ordinal suffix for the day of the month, two characters.

stndrd or th. Use in combination with j.


Numeric representation of the day of the week, starting a 0 for Sunday.

0 (for Sunday) through 6 (for Saturday)


The day of the year (starting from 0).

0 through 365



Number of the week in the year (weeks starting on Monday).

Example: 42 for the 42nd week in the year.



Complete name of the month.

January through December


Numeric representation of a month, two characters.

01 through 12


Three letter shortcut for the month of the year.

Jan through Dec


Numeric representation of a month, without leading zeros.

1 through 12


Number of days in the given month.

28 through 31



Boolean showing whether it is a leap year.

1 if it is a leap year, 0 otherwise.


Week-numbering year. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead.

Examples: 1999 or 2003


Numeric representation of a year, four digits.

Examples: 1999 or 2003


A two digit representation of a year.

Examples: 99 or 03



Lowercase am or pm.

am or pm


Uppercase AM or PM.

AM or PM


Swatch Internet time

000 through 999


12-hour format of an hour without leading zeros.

1 through 12


24-hour format of an hour without leading zeros.

0 through 23


12-hour format of an hour with leading zeros.

01 through 12


24-hour format of an hour with leading zeros.

00 through 23


Minutes with leading zeros.

00 to 59


Seconds with leading zeros.

00 through 59



Example: 654321



Example: 654



Timezone name or identifier.

Examples: UTCGMTAtlantic/Azores

I (capital i)

Boolean showing whether or not the date is in daylight saving time.

1 if Daylight Saving Time, 0 otherwise.


Difference to Greenwich time (GMT) without colon between hours and minutes.

Example: +0200


Difference to Greenwich time (GMT) with colon between hours and minutes.

Example: +02:00


The same as P, but returns Z instead of +00:00

Example: +02:00


Timezone abbreviation.

Examples: ESTMDT ...


Timezone offset in seconds.

-43200 through 50400

Full Date/Time


ISO 8601 date



Date formatted using RFC 2822.

Example: Thu, 21 Dec 2000 16:01:07 +0200


Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT).

Escape formatter

The escape formatter allows you to remove characters that might be interpreted as HTML code. To escape a variable, simply type |escape after the variable name.

What is the use case?

Imagine your chatbot is about to grab a message sent by a user and send it to a third-party software. You want to make sure that characters such as & and <, which have a specific meaning in HTML, are instead understood as plain text.

Using the following formatter on the message variable will format the content before sending it across to the external software: {{message.message|escape}}.

Explode to JSON

The explode to JSON formatter allows you to convert a simple string of text into a JSON array. This may be explicitly required for some integrations.

What is the use case?

Imagine you are trying to send the following message from your chatbot to an external piece of software which requires it in JSON: one,two,three

Your API expects a JSON array, such as ["one","two","three"].

You can use this formatter to do exactly that: {{message.message|explode_to_json_array}}

Extract value formatter

The extract value formatter allows you to extract a value appended to a postback.

What is the use case?

Imagine your business sells five different services, such as gardening services, cleaning services, and so on. You are creating a chatbot that would allow users to book your services. This chatbot contains:

  • Five FAQs, one for each service.

  • One conversation, to capture the user’s personal details.

To go from an FAQ to the conversation, you cleverly use an action message and a postback such as enquire_services. While this works perfectly, it would be quite cool to slightly modify the copy of the very first message inside the enquiry conversation to reflect which service the user was asking about originally.

With the value extract formatter, this is now possible. 

Simple append the postback on each FAQ with from(cleaning services)

Then, inside your conversation’s first message, attach a variable {{message extract=from}} to resurface the value inside from().

Number formatter

The number formatter allows you to format a number to up to 10 decimal places.

What is the use case?

Imaging you are capturing the budget of a potential customer through your lead generation chatbot. You offer them free rein to write their budget in any format they want, but you really prefer to display it with two decimal points.

This number formatter allows you to do just that: {{message.message|number_format(2)}}

Regex formatter

The extract value with regex formatter works like the extract value formatter, except it will grab the first item that matches the inputted regex.

Query parameters

The URL parameters formatter allows to extract a value behind the parameter of a URL.

What is the use case?

Imagine your chatbot lives on a page of your website. To get to that page, users need to log into your web portal. Once logged in, they are redirected to a page where they can interact with your chatbot. This page URL has the following format:

What you would really like to do is verify that every single user talking to your chatbot is actually logged in. The URL parameter formatter allows you to do that by extracting the value behind token=. Once extracted, this token can be used in an integration to verify the user is, indeed, logged in.

Convert variable type formatter

The convert variable type formatter allows you to convert data format into another.

What is the use case?

Imagine you are setting up an integration. This integration allows you to capture data inside your chatbot and send it to an external software.

Alas, the data captured inside your platform adheres to a number format and the external software only accepts JSON format. Here comes the convert variable type formatter!

Use this formatter to change number, float, or JSON formats for another.