How to count items from nodes

Hey n8nlers,

This question seems so easy but hard to get for me
In this picture below you can see that “Split Out” has 8 items and “IF true branch” has 7 item.

image

I need these counted items values for calculating.
like a ratio “Split Out” “IF true branch”.

This can not be a big issue because I already see that its counted but I dont know where to find

Thanks so much
Yänz

Its the n8n hosted version Version 1.34.2 on https://example.app.n8n.cloud/

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @Yaenz, could you tell us how you want to use the counted items value? If you want to use it within the workflow, you could maybe use the Summarize node > Count?

Of course I can do that.
In this case 8 items come from the “Split Out Node”.
For each individual query in the “IF Node” I get a true or false
At the end I need a total in which I can compare whether all items were true or more than 50% or something like that.
I dont need a Sum like a+b more like a loop counter how mamy items were found.
For this I would like to be able to calculate the items of the two nodes

Hi @Yaenz, maybe you could use a Code node to count the number of items returned in each node and then compare the two numbers. Here’s an example workflow using example data and conditions:

1 Like

sounded like a nice thing to mess around with.
This is an example of how you could do it. :slight_smile:
It calculates the percentage of the true branch, can of course me modified to do whatever. (keep in mind the set is now set to run only once as the calculation will always result in the same number of course)

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.