# Templating

FLAT's template language is intended to dynamically generate JSON documents.

Basically, you provide the skeleton of the JSON object you want to create, and use *placeholders* instead of literal values. The language supports *template commands* that are documented below. *Template expressions* and [functions](/flat/reference/functions.md) offer rich means of accessing request and response data in JSON, HTML or XML ([OXN](/flat/reference/templating/oxn.md)).

## [Comment `{{// <comment>}}`](/flat/reference/templating/comment.md)

## [Placeholder `{{ <expression> }}`](/flat/reference/templating/placeholder.md)

## [Dot `{{.}}`](/flat/reference/templating/dot.md)

## [Comma `{{,}}`](/flat/reference/templating/comma.md)

## [Pair Producer `{{: <expression> }}`](/flat/reference/templating/pair-producer.md)

## [Variable Definition `{{$<name> := <expression> }}`](/flat/reference/templating/variable.md)

## [Conditional `{{if <condition>}} … {{elseif <condition> }} … {{else}} … {{end}}`](/flat/reference/templating/if.md)

## [Loop `{{loop <array>}} … {{end}}`](/flat/reference/templating/loop.md)

## [Context Switch `{{with <expression>}} … {{else}} … {{end}}`](/flat/reference/templating/with.md)

## [Null Coalescing Operator `??`](/flat/reference/templating/null-coalescing-operator.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://sevenval.gitbook.io/flat/reference/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.
