---
title: Fold an array
description: Split array elements into individual rows.
category: Data Transformation
tags: [array, explode, unfold, flatten]
---

# Fold an array

## Description

The **Fold an Array** activity transforms an array column into multiple rows. Each element in the array becomes a new row while retaining the values from other columns. This is useful when working with datasets where array-type columns need to be normalized for easier filtering, joining, or visualization.

> **Use Case**  
> Useful in scenarios like flattening product tags, splitting multi-select values, or breaking grouped log messages into separate events.

---

## Input

| Type | Description                                         |
| ---- | --------------------------------------------------- |
| Data | Dataset with one or more columns containing arrays. |

---

## Output

| Type             | Description                                             |
| ---------------- | ------------------------------------------------------- |
| Transformed Data | Rows expanded by array elements in the selected column. |

---

## Configuration Fields

| Field Name      | Required | Description                                                           |
| --------------- | -------- | --------------------------------------------------------------------- |
| **Column Name** | Yes      | The column containing array values to be unfolded into separate rows. |

---

## Sample Input

| ID  | Array values    |
| --- | --------------- |
| 1   | ["A", "B", "C"] |
| 2   | ["X", "Y"]      |

---

## Sample Configuration

| Field       | Value          |
| ----------- | -------------- |
| Column Name | `Array values` |

<!-- ![alt text](fold-an-array-img.png) -->

---

## Sample Output

| ID  | Array values |
| --- | ------------ |
| 1   | A            |
| 1   | B            |
| 1   | C            |
| 2   | X            |
| 2   | Y            |

---
