# Split data into Batches

**URL:** <https://forum.alumio.com/t/split-data-into-batches/195>\
**Category:** Transformer Guides\
**Created:** [October 10, 2022, 12:34pm UTC](https://forum.alumio.com/t/split-data-into-batches/195 "2022-10-10T12:34:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alumio\_Bot](https://forum.alumio.com/user_avatar/forum.alumio.com/alumio_bot/32/1824_2.png) [@Alumio\_Bot](https://forum.alumio.com/u/Alumio_Bot)\
**Post date:** [October 10, 2022, 12:34pm UTC](https://forum.alumio.com/t/split-data-into-batches/195/1 "2022-10-10T12:34:53Z")

</div>

### **Table Of Contents**

- Use Case
- Application of List: split into Chunks Mapper

### **Use Case**

Let’s say you have a lot of data with prices and you need to push 1 million prices. If you push them one by one, it will take too long, but if you push 1 million at once, it won’t work as it would take too long to process. We need to find the solution somewhere in-between.

Instead of sending requests with 1 million prices or 1 million requests, we can send, for example, 10,000 requests with 100 prices. For this, we can use the value mapper _List: split into chunks_, and we can define the _Length_ of each batch.

_ **List: split into chunks** _ mapper gives a possibility to send multiple price changes, products, or customers with one request.

For example, for some systems, it can take 4 seconds to process one price. But if you send 100 prices in the same request, it only takes 7 seconds. Even though it takes 3 seconds longer, it can process 99 more prices, which is more efficient.

### **Application of _List: split into Chunks_ Mapper**

You need to build up an entity transformer and use _List: split into chunks mapper_ within it.

For this, create a new transformer:

In _ **Settings** _ select **Data, transform data using mappers and conditions**

_ **Transformers** _: **Value mapper**

In the _Accessors_ field choose one of the following:

_ **Key accessor** _ - is used to target the key of the entity data.

_ **Pattern accessor** _ - is used to target the root of the entity data.

In _ **Mappers** _ choose **List: Split into Chunks**

In the _ **Length** _ field define the size of each chunk by putting an integer.

In the example transformer in the screenshot below, an HTTP transformer is asked to pull the data and then split it into batches.

[![](https://alumio-forum.s3.dualstack.eu-central-1.amazonaws.com/uploads/original/1X/15163886e9962368f5be7a1113eb10960cac464a.jpeg)](https://s3-eu-central-1.amazonaws.com/euc-cdn.freshdesk.com/data/helpdesk/attachments/production/80057821281/original/k8gQfBPGIU-HkNKRoNoC91L_WgxZpO35Fw.png?1638443864)

[![](https://alumio-forum.s3.dualstack.eu-central-1.amazonaws.com/uploads/original/1X/e4800b50419db4affad03184e707db07fc20e1a1.jpeg)](https://s3-eu-central-1.amazonaws.com/euc-cdn.freshdesk.com/data/helpdesk/attachments/production/80057821586/original/640PdPRq7zvq1ijfF5i7BeSNI_S7IE3PVw.png?1638443901)

As we can see, the data pulled from the URL defined in an HTTP transformer was split into chunks in the _Result_ field/
