---
title: "array:assoc — Associate keys and values"
description: "iXML command array:assoc: Associate keys and values."
canonical_url: "https://www.zeyos.com/ixml/ref/array-assoc"
markdown_url: "https://www.zeyos.com/ai/guide/ixml/ref/array-assoc.md"
section: "ixml-reference"
authority: "reference"
language: "en"
source_repository: "https://cloud.zeyos.com/__doc/ixmldoc.xml"
source_sha256: "a23f04e6a98628ca3c273c3b8dd2c33c034cfda3e0f00478d8793074fd2f70dd"
---

# array:assoc — Associate keys and values

ARRAY:ASSOC creates an array of associated key and value pairs by combining two separate arrays of keys and values.

### Attributes
| Name | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| var | var |  | Result variable name |
| var_keys | var |  | Variable name for keys |
| var_values | var |  | Variable name for values |

### Children
- (none)

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

### Result
- binding: var; type: array; predicate: no-result-propagation

### Examples

```xml
<array var="keys">
	<item>bg</item>
	<item>sj</item>
</array>

<array var="values">
	<item>Bill Gates</item>
	<item>Steve Jobs</item>
</array>

<array:assoc var="names" var_keys="keys" var_values="values"/>
<output>$names.bg and $names.sj are competitors!</output>

<!-- Bill Gates and Steve Jobs are competitors! -->
```
