> ## Documentation Index
> Fetch the complete documentation index at: https://www.integrate.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ETL: BagToTuple

> Flatten a bag (array) into a tuple structure so individual items can be referenced by position. Use for data restructuring in ETL pipelines.

## Description

Flattens a bag into a tuple. Once the bag is flattened into a tuple, items can be extracted by referencing tuple items.

## Syntax

`BagToTuple(bag_expression)`

## Examples

`BagToTuple(JsonStringToBag('[1,2,3]'))` returns a tuple with the items 1,2,3.

`BagToTuple(JsonStringToBag('[1,2,3]')).$0` returns 1.

## Return value datatype

Tuple

## Impact of null value

If input is null, returns null.
