Duaer

Snippets

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 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 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 (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, or Append and Concatenate in Summarize.

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.

In this section