# create-text-from-template

## Description

<mark style="color:purple;">`create-text-from-template`</mark> *adaptor creates a dynamic text using a* [*Mustache*](https://mustache.github.io/) *template*.

## Inputs

**`template`**\
Type: `text`\
Required: Yes\
The Mustache template text that contains any number of Mustache variable tags. Variable tags are indicated by the double mustaches that surround them, e.g. `{{ person }}` is a tag.

**`variables`**\
Type: `dictionary`\
Required: Yes\
A dictionary of variable names (dictionary keys) with values (dictionary values).

## Outputs

**`text`**\
Type: `text`\
The rendered text.

## Examples

### Example 1: Default behaviour.

#### Inputs:

`template`: {{city}} is the only city in {{county}}, {{country}}, of which it is the county town. It had a population of {{population}} at the {{year}} census.

`variables`:

| KEY        | VALUE       |
| ---------- | ----------- |
| city       | World       |
| county     | Oxfordshire |
| country    | England     |
| population | 162,100     |
| year       | 2021        |

#### Outputs:

`text:` Oxford is the only city in Oxfordshire, England, of which it is the county town. It had a population of 162,100 at the 2021 census.

-> Created a dynamic text using the Mustache variable tags {{city}}, {{country}} {{county}}, {{population}} and {{year}}.

## Use Cases

* Build customized messages to combine with the [<mark style="color:purple;">`send-email-message`</mark>](https://cgps.gitbook.io/data-flo/reference-guide/send-email-message) adaptor
