---
title: Batcher and CSV parser utilities
slug: data-platform/connect-platform/ocpreference-utilities
docTags: 
createdAt: 2026-08-05T20:06:38.615Z
---

Connect Platform for Optimizely Data Platform (ODP) has utilities to help you batch API calls and parse CSV files.

## Batcher

Batcher makes it easy to batch API calls that support arrays of records or call structures. For more information, see the [App SDK API Reference documentation](docId\:gDfEVUhQwhfNSTAhL2F6s).

Batcher takes a function as input that takes an array of records and returns a promise. For example, you can use the `z.customer` or `z.event` function from the [Connect Platform Node SDK](docId\:gxEU_0AA37IEZJK-uoVcT) to send customer updates or ODP events in batches.

### Sample batcher

Below is an example of using batcher to send customer updates to ODP in bulk:

```typescript
import {CustomerPayload, z} from '@zaiusinc/node-sdk';
import * as App from '@zaiusinc/app-sdk';
import {Customer} from './Customer';

export class CustomerBatchImporter {

  public async transform() {
    const customerBatch = new App.Batcher(z.customer);

    const customers = await this.getCustomers();
    for (const customer of customers) {
      await customerBatch.append(this.transformToODPCustomer(customer));
    }

    await customerBatch.flush();
  }

  private async getCustomers(): Promise<Customer[]> {
    // get customers from external source
  }

  private transformToODPCustomer(customer: Customer): CustomerPayload {
    // transform customer to ODP customer payload
  }
}
```

## CSV parser

To parse CSV files, use the [App SDK's CsvStream](docId\:Fg0htEGqcx00Vcvflv-lB).
