---
title: "assign — Assign variable"
description: "iXML command assign: Assign variable."
canonical_url: "https://www.zeyos.com/ixml/ref/assign"
markdown_url: "https://www.zeyos.com/ai/guide/ixml/ref/assign.md"
section: "ixml-reference"
authority: "reference"
language: "en"
source_repository: "https://cloud.zeyos.com/__doc/ixmldoc.xml"
source_sha256: "a23f04e6a98628ca3c273c3b8dd2c33c034cfda3e0f00478d8793074fd2f70dd"
---

# assign — Assign variable

ASSIGN assignes the value of a source variable to a target variable.

These three statements are semantically equivalent:

					<assign var="var[key]" var_source="var_source"/>
					<assign var="var.key" var_source="var_source"/>
					<assign var="var" key="key" var_source="var_source"/>

					These three statements are semantically equivalent:

					<assign var="var" var_source="var_source[key]"/>
					<assign var="var" var_source="var_source.key"/>
					<assign var="var" var_source="var_source" key_source="key"/>

### Attributes
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| var | var |  | Target variable name |
| var_source | var |  | Source variable name |
| key | string | (no key) | Target key |
| key_source | string | (no key) | Source key |

### Children
- (none)

### Parents
- (not restricted in the reference)

### Result
- binding: var; type: n/a; predicate: no-result-propagation

### Examples

```xml
<set var="name1">iXML</set>
<assign var="name2" var_source="name1"/>
<output>$name2</output>
<!-- iXML -->
```
