# Jinja filters

In addition to the [built-in Jinja filters](https://jinja.palletsprojects.com/templates/#filters) Atfinity defines more useful filters you can use in your templates:

| Name                        | Description                                                                                                                                                   |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `value_or_nothing`          | Returns an empty string if the value is `None`.                                                                                                               |
| `is_known`                  | Returns `True` if the value is not `None` (i.e. known).                                                                                                       |
| `is_unknown`                | Returns `True` if the value is `None` (i.e. unknown).                                                                                                         |
| `format_date`               | Formats a date with the given format string, e.g. `{{p.date_of_birth \| format_date('DD/MM/YYYY')}}`. Uses the document language.                             |
| `format_date_speaking`      | Formats a date in a human-readable format (`D. MMMM YYYY`). Uses the document language.                                                                       |
| `format_date_time`          | Formats a datetime with optional `date_format` and `time_format` arguments. Uses the document language.                                                       |
| `format_date_time_speaking` | Formats a datetime in a human-readable format. Uses the document language.                                                                                    |
| `yyyymmdd`                  | Converts a date to the `yyyyMMdd` string format.                                                                                                              |
| `yes_or_nothing`            | Returns `"Yes"` for `True`, empty string otherwise.                                                                                                           |
| `yes_or_no`                 | Returns `"Yes"` for `True`, `"No"` for `False`.                                                                                                               |
| `skip_digits`               | Removes all digits from a string.                                                                                                                             |
| `extract_digits`            | Returns only the digits from a string.                                                                                                                        |
| `format_map`                | Formats a string using named placeholders, e.g. `{{template_string \| format_map(name='Thorben')}}`. Missing placeholders are left as-is.                     |
| `deep_get`                  | Retrieves a nested value from a dictionary using a dot-separated key path, e.g. `{{data \| deep_get('address.city')}}`. Returns `None` if any key is missing. |
| `to_ascii`                  | Converts a Unicode string to ASCII by removing accents and transliterating ligatures (e.g. `ü` → `u`, `ß` → `ss`).                                            |


---

# Agent Instructions: 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.atfinity.io/document-xml-adx/jinja-templating/jinja-filters.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.
