For the complete documentation index, see llms.txt. This page is also available as Markdown.

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
	}
]

Last updated

Was this helpful?