# Text Composition (TextCompositionGenerator)

The [Text Composition](https://docs.tonic.ai/app/generation/generators/generator-reference/text-composition) generator creates a text string that includes values from other columns in the same row.

## Link object structure

The Text Composition generator does not support configuration of linking or consistency. You cannot configure differential privacy.

The metadata object is populated from the `TextCompositionMetadata` object.

The generator-specific configuration is the template to use to populate the value. The template uses the [Liquid template syntax](https://liquidjs.com/filters/overview.html).

{% code overflow="wrap" %}

```json
{
  "presetId": "string",
  "generatorId": "TextCompositionGenerator",
  "schema": "string",
  "table": "string",
  "column": "string",
  "dataType": "string", //MongoDB only
  "metadata": {
​    "template": "string"
​  },
​  "encryptionProcessor": "x-on", //To use configured Structural data encryption
  "customValueProcessor": "string" //If custom value processor applied
}
```

{% endcode %}

## Example replacement

The following example applies the Text Composition generator string to a `nameabbrev` column. The value includes the full value of the `lastname` column, and the first character of the `firstname` column.

{% code overflow="wrap" %}

```json
{
  "name": "nameabbrev",
  "schema": "public",
  "table": "users",
  "links": [
    {
      "presetId": "TextCompositionGenerator",
      "generatorId": "TextCompositionGenerator",
      "schema": "public",
      "table": "users",
      "column": "nameabbrev",
      "metadata": {
        "template": "{{ lastname }}, {{ firstname | slice: 0, 1 }}"
      }
    }
  ]
}
```

{% endcode %}


---

# 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.tonic.ai/app/api/quick-start-guide/tonic-api-generator-assignment/generator-api-reference/text-composition-textcompositiongenerator.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.
