> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alumio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set values

> Adds or updates data at specific keys in the context. Supports placeholders to reference existing data.

export const FormField = ({property, label, required = false, diType, uiPatterns, children}) => {
  const patterns = Array.isArray(uiPatterns) ? uiPatterns : uiPatterns ? [uiPatterns] : [];
  return <div style={{
    margin: '1.5rem 0'
  }}>
      <div style={{
    display: 'flex',
    alignItems: 'baseline',
    flexWrap: 'wrap',
    gap: '0.5rem',
    marginBottom: '0.25rem'
  }}>
        <strong>{label}</strong>
        <span style={{
    fontSize: '0.7rem',
    fontWeight: 600,
    textTransform: 'uppercase',
    letterSpacing: '0.04em',
    color: required ? '#6241f5' : '#6b7280'
  }}>
          {required ? 'Required' : 'Optional'}
        </span>
      </div>

      <div>{children}</div>

      {diType || patterns.length > 0 ? <p style={{
    fontSize: '0.85rem',
    color: '#6b7280',
    marginBottom: 0
  }}>
          {diType ? <>
              See the <a href={`/references/${diType}`}>{diType}</a> reference.{' '}
            </> : null}
          {patterns.length > 0 ? <>
              Accepts a <a href={`/documentation/placeholders-and-patterns/patterns#${patterns[0]}`}>pattern</a>.
            </> : null}
        </p> : null}
    </div>;
};

Adds new values to your data or updates existing ones. You name a path and give it a value: if the path already exists its value is replaced, and if it does not it is created. This is one of the most-used transformers, handy for setting a fixed value like a channel name, or for building a new field out of existing data with placeholders such as `&{first_name} &{last_name}`. You can set several values in one step, and they are applied in order, so a later value can build on one you just set.

This documentation describes: [Schema](/schemas/transformer/value-setter)

## Fields

<FormField property="configurations" label="Configurations">
  The list of values to set. Add a row for each value you want to write; you need at least one. Each row sets one value at one path, so add as many as you need to populate several fields at once.
</FormField>

<FormField property="configurations[].key" label="Key" required>
  The path where the value is written, in dot notation. For example `pricing.amount` creates a `pricing` block with an `amount` inside it. If the path already exists its value is overwritten; otherwise it is created. The path supports placeholders such as `&{...}`, so it can be built from other data. See [Placeholders](/references/placeholders) for the syntax.
</FormField>

<FormField property="configurations[].value" label="Value">
  The value to place at the path. It can be plain text, a number, a yes/no toggle, a list, or a structured block. Text values support placeholders such as `&{product.name}` to pull in existing data, which are filled in before the value is set. Leave it empty to set an empty value.
</FormField>

<FormField property="configurations[].mappers" label="Mappers" diType="mapper">
  An optional list of conversions applied to the value before it is set, for example trimming whitespace or changing text to uppercase. Add several and they run in the order you list them. Leave it empty to write the value as-is.
</FormField>

## Sample data

| Field | Value                                           |
| ----- | ----------------------------------------------- |
| Key   | `full_name`, value `&{first_name} &{last_name}` |
| Key   | `status`, value `active`                        |

Input:

```json theme={null}
{
    "first_name": "Anna",
    "last_name": "de Vries",
    "country": "NL"
}
```

Output:

```json theme={null}
{
    "first_name": "Anna",
    "last_name": "de Vries",
    "country": "NL",
    "full_name": "Anna de Vries",
    "status": "active"
}
```

```json Configuration theme={null}
{
  "prototype": "value-setter",
  "parameters": {
    "configurations": [
      { "key": "full_name", "value": "&{first_name} &{last_name}" },
      { "key": "status", "value": "active" }
    ]
  }
}
```
