> For the complete documentation index, see [llms.txt](https://doc.duaer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/snippets/split-array-into-items.md).

# Split an array into separate items in Duaer

Duaer nodes run once per item. Split an order line list or an API array into one item per entry with Split Out so the next nodes handle each one.
## Split an array with Split Out

1. Add [Split Out](/build/split-out.md) after the node that holds the array.
2. Set Fields To Split Out to the array field, such as line_items; use data.items for nested paths.
3. Under Include, keep No Other Fields, All Other Fields, or Selected Other Fields for a few, such as the order number.
4. Select Execute step. You get one item per array entry.

When the field is text such as a,b,c, turn it into an array first in [Edit Fields](/build/edit-fields.md) with {{ $json.tags.split(",") }}, type Array, then split.

## Split with Code and keep parent fields

To rename fields or carry parent data at the same time, use [Code](/build/code.md) (Run Once for All Items):

```
return $input.all().flatMap((item) =>
  item.json.line_items.map((line) => ({
    json: { order: item.json.name, ...line },
  })),
);
```

## The reverse: combine items into one array

To combine items back into one array or one text, use [Aggregate](/build/aggregate.md), or Append and Concatenate in [Summarize](/build/summarize.md).

## Duaer online tools

- [JSON to CSV converter (nested JSON flattened)](https://doc.duaer.com/tools/json-to-csv.md)
- [JSON formatter and validator online (shows error line and column)](https://doc.duaer.com/tools/json-formatter.md)
## Questions

### After splitting in Duaer, how do I know which order each entry belongs to?

In Duaer Split Out, set Include to Selected Other Fields and keep the order number, or use the Code version on this page to copy parent fields.

### Which Duaer node combines split items back?

Use the Duaer Aggregate node, or Append and Concatenate in Summarize.

## Related

- [Split a list into items with Split Out in Duaer](https://doc.duaer.com/build/split-out.md)
- [Aggregate items into one list in Duaer](https://doc.duaer.com/build/aggregate.md)
- [Understand Duaer’s data structure](https://doc.duaer.com/data/data-structure.md)
- [Group, sum, and count items in Duaer (like a pivot table)](https://doc.duaer.com/snippets/group-and-sum.md)

