> ## 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: MapToBag

> Convert a map into a bag of key-value pair maps for iteration. Use MAPTOBAG for processing map entries in Integrate.io ETL pipeline expressions.

## Description

Transforms a hash map to a bag of hash maps where each map contains two keys: key and value.

## Syntax

`MapToBag(map_expression)`

## Examples

`MapToBag(TOMAP('a',1,'b',2,'c',3))` returns a bag with the following items: \[key#a,value#1],\[key#b,value#2],\[key#c,value#3]

## Return value datatype

Bag

## Impact of null value

If input is null, returns null.
