> For the complete documentation index, see [llms.txt](https://docs.atfinity.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.atfinity.io/document-xml-adx/jinja-templating/instances.md).

# Instances

For each matched instance a variable with the identifier is created containing an Instance Wrapper object. This object has a list of methods available to access information and meta information about the matches instance.

#### `[information_key]`

For each information key a method is created to load that information value. For example if you have a Person with the information `first_name` and `last_name` then you can access them directly as properties with `{{p.first_name}}` and `{{p.last_name}}`.

#### `get(information_key, sneaky=False)`

Returns the value of the given information key. The optional `sneaky` parameter controls whether accessing this information marks it as necessary in the process — the same concept as the RuLa [SNEAKY](/rule-language/operators/unknown-operators/sneaky.md) operator.

* `sneaky=False` (default): accessing the value may cause the information to be requested from the user.
* `sneaky=True`: the value is accessed without making the information necessary.

```markup
<text>{{p.get('first_name')}}</text>
<text>{{p.get('first_name', sneaky=False)}}</text>
<text>{{p.get('first_name', sneaky=True)}}</text>
```

#### `is_known(information_key, sneaky=False)`

Returns `True` if the given information key has a known (non-unknown) value, `False` otherwise. The optional `sneaky` parameter works the same as for `get()`: when `True`, checking whether the value is known does not make the information necessary.

* `sneaky=False` (default): may cause the information to be requested from the user.
* `sneaky=True`: checks the value without making the information necessary.

```markup
<text>{{p.is_known('first_name')}}</text>
<text>{{p.is_known('first_name', sneaky=False)}}</text>
<text>{{p.is_known('first_name', sneaky=True)}}</text>
<text>{{p.is_known('nonexistent_field', sneaky=True)}}</text>
```

Note that `is_known` is also available as a [Jinja filter](/document-xml-adx/jinja-templating/jinja-filters.md) for use in filter pipelines.

#### **`translate(information_key)`**

Accessing information directly returns the value you would also get if you would access it with rula. For an enum value this means you would get e.g. `de` instead of `Germany` and for a unit value this means you get `55` instead of `55 kg`. Using translate, you will get the value in the requested language of the document. You probably want to use `translate(...)` almost by default.

#### `information_title(information_key)`

Returns the translated title of the information\_key. E.g `First Name` for `information_title('first_name')`.

#### `field_id(information_key)`

Return the field\_id for an information\_key. This contains both the instance\_id and the information\_key. This is meant to be used with editable fields to provide a way to identify the field, for example like this:

```xml
<field 
  id="{{p.field_id('first_name')}}" 
  title="{{p.information_title('first_name')}}"
>
  {{p.first_name}}
</field>
```

#### `proof_file(proof_key)`

Returns the path to the uploaded proof file to display proofs on ADX documents. This most likely is combined with an `<image>` tag, for example like this:

```xml
<image
  path="{{c.proof_file('credit_key_account_plan')}}"
  width="16cm"
  height="16cm"
/>
```


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.atfinity.io/document-xml-adx/jinja-templating/instances.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
