Slice CSV

View as Markdown

The Slice CSV node takes a large spreadsheet and divides it into a set of smaller files, each small enough to read in one pass. It hands back the list of pieces so a For Each loop can work through them one at a time, reading each with Parse CSV. It is the answer to a file that is simply too big to process whole.

When to use it

  • A file has too many rows to read in a single step and you need to work through it in chunks.
  • You are importing a large list and want to hand each piece to a step that accepts only so many records at a time.
  • A recurring import can arrive at any size and you want it to process reliably whether it holds a hundred rows or tens of thousands.

Inputs

FieldWhat it’s forExample
FileThe large spreadsheet to divide, usually from an upload or an earlier step.The file uploaded at the start of the run
Has HeaderWhether the first row is column names. When yes, the header is copied into every piece so each one stands on its own.Yes
Max RowsAn optional cap on how many rows each piece may hold, when a later step needs pieces smaller than the automatic size.1000

The file usually comes from an earlier step written as an expression.

Outputs

FieldWhat you get back
SlicesThe list of smaller files, in order. Loop over these to process the whole file.
Slice CountHow many pieces were produced.
Total RowsHow many data rows were in the original file.

Example

Chen Insurance Group runs a nightly import that can bring in anywhere from a few hundred to twenty thousand contacts. A Slice CSV node divides the uploaded file into pieces of at most a thousand rows each, capped so every piece is exactly one bulk-import call. A For Each loop then reads each piece with Parse CSV and adds its contacts, so the same workflow handles a small file and a huge one the same way.

The Slice CSV configuration panel, showing the file source, header setting, and max rows.

The Has Header setting here must match what you tell Parse CSV inside the loop. When you slice with a header, each piece carries its own copy of the header row, so the parse step should also expect one. An empty or header-only file is fine: it simply produces no pieces, and the loop does nothing.