---
schema_version: "1"
id: 5d916a75c38d9f63218ff7103241104c5f4a9112be627f5d3a753b4362bc0ab2
title: unzip
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/latest/dw-core-functions-unzip.md
canonical_url: https://docs.mulesoft.com/dataweave/latest/dw-core-functions-unzip
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 3d1fe317f49e350ee90ac9e1c05211a343563f0a6122932735e6cdbbb7e921e8
description: MuleSoft Documentation Site
release: "2.13"
latest: true
---
---
product: DataWeave
version: 2.13
is-latest-version: true
---

# unzip

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## unzip<T>(items: Array<Array<T>>): Array<Array<T>>

Performs the opposite of `zip`. It takes an array of arrays as input.

The function groups the values of the input sub-arrays by matching indices, and it outputs new
sub-arrays with the values of those matching indices. No sub-arrays are produced for unmatching
indices. For example, if one input sub-array contains four elements (indices 0-3) and another only
contains three (indices 0-2), the function will not produce a sub-array for the value at index 3.

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>items</code></p></td><td><p>The input array of arrays.</p></td></tr></tbody></table>

### Example

This example unzips an array of arrays. It outputs the first index of each sub-array into one array
`[ 0, 1, 2, 3 ]`, and the second index of each into another `[ "a", "b", "c", "d" ]`.

#### Source

```DataWeave
%dw 2.0
output application/json
---
unzip([ [0,"a"], [1,"b"], [2,"c"],[ 3,"d"] ])
```

#### Output

```JSON
[ [ 0, 1, 2, 3 ], [ "a", "b", "c", "d" ] ]
```

### Example

This example unzips an array of arrays. Notice that the number of elements in the input arrays is
not all the same. The function creates only as many full sub-arrays as it can, in this case, just
one.

#### Source

```DataWeave
%dw 2.0
output application/json
---
unzip([ [0,"a"], [1,"a","foo"], [2], [3,"a"] ])
```

#### Output

```JSON
[0,1,2,3]
```

### Example

This example unzips an array of arrays where each input subarray contains more than two elements. It
shows that `unzip` can produce more than two output subarrays when there are additional values at
each index.

#### Source

```DataWeave
%dw 2.0
output application/json
---
unzip([ [0,"a","W"], [1,"b","X"], [2,"c","Y"], [3,"d","Z"] ])
```

#### Output

```JSON
[
 [0,1,2,3],
 ["a","b","c","d"],
 ["W","X","Y","Z"]
]
```
