> ## 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 global variable

> Sets a variable in the global scope.

Sets a variable in the global scope. Use this to remember a value once and reuse it anywhere later in the same run, even across different steps. You give the variable a name and a value (which can pull in data from the item currently being processed), and from then on you can drop that value into any field with the placeholder `@{globals.<name>}`. It is handy for things like a default shipping country, a batch reference, or a timestamp that several later steps all need to share.

This step does not change the item itself; it only stores the value behind the scenes for the rest of the run to use.

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

## Fields

**Key**

Required

The name you give the variable. You read the value back later with the placeholder `@{globals.<key>}`, so a key of `default_country` becomes `@{globals.default_country}`. Pick a short, descriptive name.

**Value**

Required

The value to store under that name. You can type a fixed value or use a placeholder such as `&{order.customer.country}` to capture data from the item currently being processed. The placeholder is filled in at the moment this step runs, and the result is what gets saved. See [Placeholders](/references/placeholders) for the full syntax.

## Sample data

This example stores the item's country as a global variable named `default_country`, then a later step reads it back with `@{globals.default_country}` and writes it to `shipping_country`. The stored value is kept behind the scenes, so the visible change shows up only once a later step uses it.

| Field | Value |
| - | - |
| Key | `default_country` |
| Value | `&{order.customer.country}` |

Input:

```json theme={null}
{
    "order": {
        "customer": {
            "country": "NL"
        }
    }
}
```

Output:

```json theme={null}
{
    "order": {
        "customer": {
            "country": "NL"
        }
    },
    "shipping_country": "NL"
}
```

```json Configuration theme={null}
{
  "prototype": "global-variable-setter",
  "parameters": {
    "key": "default_country",
    "value": "&{order.customer.country}"
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.