> For the complete documentation index, see [llms.txt](https://docs.api.intratool.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.api.intratool.de/introduction/system-variables/formatters.md).

# Formatters

Formatters are used to transform system variable values during rendering. They can be applied to system variables in any context where they are supported, allowing you to format dates, user names, addresses, and more in a consistent way across your automations.

## Syntax

```twig
{{ variable|formatter_key }}
{{ variable|formatter_key(arg1, arg2) }}
```

Even multiple formatters are possible:

```twig
{{ variable|formatter_key1|formatter_key2(arg) }}
```

## Available formatters

| Formatter key               | Description                                                                                                              | Arguments (optional)                                                                           | Example                                                            | Result (example output)                |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ | -------------------------------------- |
| `date`                      | Twig-compatible date formatter (overrides Twig default to return empty string for empty values).                         | `format: string`, `timezone: string`                                                           | `{{ system.date\|date('Y-m-d H:i', 'Europe/Berlin') }}`            | `2026-04-29 14:30`                     |
| `format_date`               | Formats a value as date.                                                                                                 | `dateFormat: string`                                                                           | `{{ system.date\|format_date('d.m.Y') }}`                          | `29.04.2026`                           |
| `format_date_database`      | Formats a value using database date format.                                                                              | `dateFormat: string`                                                                           | `{{ system.date\|format_date_database }}`                          | `2026-04-29`                           |
| `format_datetime`           | Formats a value as date + time.                                                                                          | `dateFormat: string`                                                                           | `{{ system.date\|format_datetime('d.m.Y H:i') }}`                  | `29.04.2026 14:30`                     |
| `format_datetime_database`  | Formats a value using database datetime format.                                                                          | `dateFormat: string`                                                                           | `{{ system.date\|format_datetime_database }}`                      | `2026-04-29 14:30:00`                  |
| `format_date_period`        | Formats a period value with `start` and `end`; if both are equal, only one date is returned.                             | `dateFormat: string`, `delimiter: string`                                                      | `{{ period\|format_date_period('d.m.Y', 'to') }}`                  | `29.04.2026 to 02.05.2026`             |
| `format_datetime_period`    | Like `format_date_period`, but with datetime format.                                                                     | `dateFormat: string`, `delimiter: string`                                                      | `{{ period\|format_datetime_period('d.m.Y H:i', 'to') }}`          | `29.04.2026 08:00 to 29.04.2026 17:00` |
| `format_time`               | Formats a value as time only.                                                                                            | `dateFormat: string`                                                                           | `{{ system.date\|format_time('H:i') }}`                            | `14:30`                                |
| `format_time_period`        | Formats a `start`/`end` period as time only.                                                                             | `dateFormat: string`, `delimiter: string`                                                      | `{{ period\|format_time_period('H:i', '-') }}`                     | `08:00 - 17:00`                        |
| `format_department_name`    | Resolves and formats a department display name (expects a department-like value with `id`).                              | -                                                                                              | `{{ system.user.role.department\|format_department_name }}`        | `Operations`                           |
| `format_form_field_results` | Renders form field results as HTML output (supports form messages and task executions, including child task executions). | `includeEmptyFields: bool`, `includeDescriptionFields: bool`, `useGrid: bool`                  | `{{ formMessage\|format_form_field_results(false, false, true) }}` | `<p><strong>Field</strong>: Value</p>` |
| `format_user_address`       | Formats a user's address (expects a user-like value with `id`).                                                          | `multiLine: bool`                                                                              | `{{ system.user\|format_user_address(true) }}`                     | `Main St 1\n12345 Berlin`              |
| `format_user_name`          | Formats a user's display name (expects a user-like value with `id`).                                                     | `showUserGroup: bool`, `showUsername: bool`, `showGroupAccount: bool`, `reverseFullName: bool` | `{{ system.user\|format_user_name(true, false, false, false) }}`   | `Max Mustermann (Operations)`          |
| `format_task_status`        | Translates a task status value (e.g. `open`, `done`) to localized output.                                                | -                                                                                              | `{{ taskExecution.status\|format_task_status }}`                   | `Open`                                 |
| `p2br`                      | Converts paragraph HTML blocks to `<br>`-based line breaks.                                                              | `pTag: string`                                                                                 | `{{ formMessage.body\|p2br('p') }}`                                | `Line 1<br>Line 2`                     |
| `strip_html`                | Removes HTML tags; supports keeping selected tags and line-break conversion options.                                     | `ignoreTags: string`, `p2br: bool`, `br2nl: bool`                                              | `{{ formMessage.body\|strip_html('<a><br>', true, false) }}`       | `Hello <a href="#">link</a><br>World`  |

## Notes

* Unknown formatter keys are ignored at runtime and result in an empty replacement for that formatter call.
* `format_user_name`, `format_user_address`, and `format_department_name` require resolvable entity IDs in the input value.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.api.intratool.de/introduction/system-variables/formatters.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.
