---
title: Triggered unfold
description: Reassemble grouped rows into a structured tabular format based on a trigger value.
category: Data Transformation
tags: [unfold, sessionize, restructure, event data, transformation]
---

# Triggered unfold

## Description

The **Triggered Unfold** activity converts multiple event-style rows into a single structured record by unfolding rows based on a trigger condition.

This is particularly useful when working with event logs or session-based records, where each session starts with a special event type (e.g., `START`) and is followed by other events (e.g., `DATA`). The activity uses a trigger value (like `START`) to determine when a new group begins, and then flattens the related rows into a single output row.

> **Use case**:  
> This activity can be used to consolidate log-style entries into structured records per session. For example, transforming application logs with event sequences like `START`, `DATA`, and `END` into a flat summary per session.

---

## Input

- **Data** – Required  
  A table containing sessional or sequential rows with repeated identifiers (e.g., SessionID, UserID, etc.).

---

## Output

| Output Type | Format  | Description                                                           |
| ----------- | ------- | --------------------------------------------------------------------- |
| **Data**    | Tabular | A flattened table with values grouped by the key and trigger pattern. |

---

## Configuration Fields

| Field Name        | Description                                                                                   |
| ----------------- | --------------------------------------------------------------------------------------------- |
| **Key Column**    | Required. The column used to group related rows together (e.g., SessionID).                   |
| **Fold Column**   | Required. The column used to identify the type of each row (e.g., START, DATA).               |
| **Trigger Value** | Required. The specific value in the fold column that signals the start of a new group.        |
| **Data Column**   | Required. The column containing the actual values to be placed into structured output fields. |

---

## Sample Input

| SessionID | EventType | EventData |
| --------- | --------- | --------- |
| 1         | START     | A         |
| 1         | DATA      | B         |
| 1         | DATA      | C         |
| 2         | START     | X         |
| 2         | DATA      | Y         |

---

## Sample Configuration

| Field         | Value     |
| ------------- | --------- |
| Key Column    | SessionID |
| Fold Column   | EventType |
| Trigger Value | START     |
| Data Column   | EventData |

---

## Sample Output

| SessionID | START | DATA |
| --------- | ----- | ---- |
| 1         | A     | C    |
| 2         | X     | Y    |
