> For the complete documentation index, see [llms.txt](https://docs.milientsoftware.com/help/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.milientsoftware.com/help/moment-by-topic/integrations/file-exports/export-templates/template-editor/edit-template/content.md).

# Content

The content field in the export template editor is based on Apache Freemarker and supports most of the built-in references from this. See more information on these [here](https://freemarker.apache.org/docs/ref_builtins.html).

How to use date and time formatting in the editor can be found [here](https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html).

### Features

The content field has a number of built-in features that can be used

#### Lists

You can create lists, this is a method to loop through records. In the code block below you see how to define a list. The #list is the function name, \[recordset] refers to the recordset from the datatype used for the list. \[variable] is the value used within the list to get fields from the recordset. The indented second line shows how a field would be referred to using variable and field name.

```
<#list [recordset] as [variable]>
    #{[variable].[fieldname]}
</#list>
```

#### Functions

The editor also supports the creation of functions that can be used within it. Add these at the bottom of the editor. A function is used by using ? as prefix for the field.

```
<#function [functionName] [variable]>
  <#if [variable] == ‘something’>
    <#return “Found something”>
  </#if>
    <#return “Did not find something”>
</#function>

```

#### Inline functions

There exists a number of inline functions that can be used also

| Field prefix | Function        | Description                                                      |
| ------------ | --------------- | ---------------------------------------------------------------- |
| #            | ?string(“0.00”) | Used on numeric fields to define how to format the number        |
| ?            | ?leftPad(X,””)  | Used to pad the field value to the left with defined characters  |
| ?            | ?rigthPad(X,"") | Used to pad the field value to the right with defined characters |

### Fields

Each datatype has a number of fields available to be included in the export.

These can be seen in the list of available fields.


---

# 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.milientsoftware.com/help/moment-by-topic/integrations/file-exports/export-templates/template-editor/edit-template/content.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.
