# How to map fields from a nested array into one array

**URL:** <https://community.synatic.com/t/how-to-map-fields-from-a-nested-array-into-one-array/343>\
**Category:** Mapper\
**Tags:** flows, calculator, mapper\
**Created:** [April 25, 2023, 4:32pm UTC](https://community.synatic.com/t/how-to-map-fields-from-a-nested-array-into-one-array/343 "2023-04-25T16:32:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Faizel](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.synatic.com/faizel/32/918_2.png) [@Faizel](https://community.synatic.com/u/Faizel)\
**Post date:** [April 25, 2023, 4:32pm UTC](https://community.synatic.com/t/how-to-map-fields-from-a-nested-array-into-one-array/343/1 "2023-04-25T16:32:44Z")

</div>

If you require to **map fields from a nested array into a single array** , please follow the instructions below:

Illustrated in the image below is an example of a flow where a Record Generator is used as a source step, the payload is then being mapped, grouped and stored in a buffer.

 ![image](https://canada1.discourse-cdn.com/flex032/uploads/synatic/original/2X/a/a6f8f9b35712b9b194b66f7fff4705c9e2b49657.png)

The below image is a Record Generator source step which contains a JSON payload with a nested array.

 ![image](https://canada1.discourse-cdn.com/flex032/uploads/synatic/original/1X/85f600fd0181bb10e95de1a46efc8cb2e1ffa325.png)

The page below is the output from the Record Generator.

 ![image](https://canada1.discourse-cdn.com/flex032/uploads/synatic/original/1X/50bfb1086ea20e0715ab54a7fc618ef4a101a866.png)

The Super Mapper is used to map 2 of the nested array fields to a new array as shown in the below image.

 ![image](https://canada1.discourse-cdn.com/flex032/uploads/synatic/original/1X/dd4f7b11b9024107d96746caef0ea585d27a5e6b.png)

The below image is the output from the Super Mapper step.

 ![image](https://canada1.discourse-cdn.com/flex032/uploads/synatic/original/1X/c0c399872406d81ca410c242423cef340e6dde8f.png)

The Group step groups the data based on the array name as illustrated in the below image.

 ![image](https://canada1.discourse-cdn.com/flex032/uploads/synatic/original/2X/b/b15127c8a868bffe018fe069b8f3186a9f2d47aa.png)

A Calculator step is added after the Group step to test how the dataset gets returned after the field/array is grouped. The output is returned as shown in the below image.

 ![image](https://canada1.discourse-cdn.com/flex032/uploads/synatic/original/1X/136e3de81140e1d9bac035e98a454db5543a1939.png)

The below image is a Calculator step that contains a nested for loop in JSON.

 ![image](https://canada1.discourse-cdn.com/flex032/uploads/synatic/original/2X/d/dd8f5aa39981cbd31da4040ab5bac3982d4e56f0.png)

The below page is the returned data after the Calculator step where the required fields from the nested array is returned in one array.

 ![image](https://canada1.discourse-cdn.com/flex032/uploads/synatic/original/1X/b6aa4849415bbe4c918225b5e3f452e4beb9ff89.png)
