# Handlebars Helper Function: set

Performs local variable assignment within its block scope. It injects one or more variables into the current context for use only within the block. Variables assigned with `set` are local to the block and don’t persist outside the `{{#set}}...{{/set}}` block.

## Availability

This helper is available in the Winter ’26 release of Marketing Cloud Next.

## Syntax

```handlebars
{{#set var1=value1 ... varN=valueN }}
  Block content that can access var1 ... varN.
{{/set}}
```

## Parameters

| Parameter | Type | Description                                                                                                                            |
| --------- | ---- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `varName` | Any  | Variable name and value pairs such as `name="John"` and `age=30`. Variable names must be valid identifiers. Set at least one variable. |

## Return Value

The function returns the rendered content of the block with all the specified variables available in the context. The variables are available only within the block scope and don’t persist outside of it.

The helper creates a new context by cloning the existing one, adding the provided key-value pairs, and then rendering the inner block with the updated context. This method preserves the parent context. All parent variables remain accessible directly, unlike the `with` helper, which replaces the context.
