Duaer

Troubleshooting

Fix "Code doesn't return items properly" in the Duaer Code node

The Duaer Code node expects an array of items or an object. A missing return, a string, or an array of numbers raises these errors.

Duaer Code node errors

  • Code doesn't return items properly: Run Once for All Items mode with no return, or an array holding strings or numbers.
  • Code doesn't return an object: Run Once for Each Item mode without an object.
  • Code doesn't return a single object: Run Once for Each Item mode returned an array. To turn one item into many, switch to Run Once for All Items.
  • A 'json' property isn't an object: you returned something like { json: "text" }. json must hold an object.
  • Unknown top-level item key: some items in the array use json and some do not.

Return this shape

Run Once for All Items mode:

return $input.all().map((item) => ({
  json: { ...item.json, total: item.json.price * item.json.qty },
}));

Wrap plain strings first: return list.map((name) => ({ json: { name } })). Refer to Split an array into items in Duaer.

Questions

Can the Duaer Code node return a single object?

Yes. Duaer treats one object as one output item. For several, return an array of objects.

Which Duaer Code node mode should I use?

In Duaer, use Run Once for All Items to total, split, or change the item count. Run Once for Each Item to edit each item and keep the count.

In this section