# Templating Language

Thread-Watcher's pipeline allows you to "carry" data from one module to the subsequent modules in the pipeline. Any value captured in can be injected into messages, embeds, and even button labels.

The ticket panel configuration screen of the website makes finding and inserting these variables a breeze. Simple type `{{` wherever you want to use a variable in a text and a "picker" of different variables will appear on screen where supported!

### The Basics

Variables are wrapped in curly braces: `{{variable}}` \
You can access specific properties of a variable by dot notation: `{{variable.property}}`\
For example, to greet a user we can do:

```handlebars
Hello there, {{env.user.tag}}
```

### Lists

So far we've looked into "atomic" variables. But, a variable can also be a list of variables. Consider a ticket with a pop-up asking the user to define categories for their ticket. In this case the user might choose multiple available options.

Thread-Watcher handles these variables as *lists*. To access a specific variable in a list you use the square brackets and indicate which item you want to select, such as `module.options[2]` to select the third selected option.&#x20;

Thread-Watcher lists are *0 indexed* which means the first item in our list has the index of 0.

We can also access lists "backwards" by providing a negative index. \
For example `module.options[-1]` will give us the last item and `module.options[-2]` will give us the second to last answer

### Functions

functions will be added at a later time. Thanks for reading :D


---

# 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.threadwatcher.xyz/features/tickets/templating-language.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.
