# Jinja Templating

We use Jinja to render case information on ADX documents. This documentation will only explain a very very basic concept of Jinja. Please head to the [offical Jinja documentation](https://jinja.palletsprojects.com) for details.

## Using Jinja Instructions

Jinja instructions can be added to ADX documents anywhere. They start with {{ and end with }} and use a Python like syntax. E.g. this displays the result of 5 + 6:

```markup
<adx>
  <body>
    <text>{{5 + 6}}</text>
  </body>
</adx>
```

## Displaying Case Information

To display case information per matched instance you have a special variable available in the jinja template. Take for example a document with a condition `e is Entity`. Now when this document is rendered a variable `e` will be available in the template and give you access to information and meta information about the matched instance, for example you can display the legal status enum information and the title in a field:

```markup
<adx>
  <body>
    <field title="{{e.information_title('legal_status')}}">
      {{e.translate('legal_status')}}
    </field>
  </body>
</adx>
```

All options are described in [Instance Wrapper](/document-xml-adx/jinja-templating/instances.md).


---

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