Get number of items returned by last node
To get the number of items returned by the previous node:
if (Object.keys(items[0].json).length === 0) {
return [
{
json: {
results: 0,
}
}
]
}
return [
{
json: {
results: items.length,
}
}
];The output will be similar to the following.
[
{
"results": 8
}
]The output will be similar to the following.
Related resources
Last updated
Was this helpful?