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
Write a short step with Code in Duaer
In Duaer, Code runs JavaScript or Python on the current items. Prefer Edit Fields when you only change a few fields.
SnippetsSplit 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.
DataUnderstand Duaer’s data structure
Understanding how Duaer structures and passes data between nodes is fundamental to building digital organizations. This guide covers the data structure format and how data flows.
ExpressionsUse built-in methods and variables in Duaer
Duaer's built-in methods and variables for working with data in expressions. The Code node runs plain JavaScript and native Luxon.