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

# Formatters

Formatters transform System Variable values during rendering. They provide consistent output for dates, names, addresses, HTML, and other supported values.

Multiple formatters can be chained, and each formatter receives the output of the previous formatter.

## Syntax

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

Chain multiple formatters with additional pipe characters:

```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`  |

## Formatter Behavior

* 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.
