Filtering by finding an item in an array

Hello, I want to use a Filter node to pass only items found in an array (see the screenshot). Nothing is returned. Why?

I also checked the code of this node on Github but as far as I understand it, it shouldn’t matter if the condition is A = B or B = A.

I can implement it with Code node, but I want to understand the reason.
Thank you.

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:

The output shows that one item has been kept - the other Tab. What is inside there?
If the filter works the wrong way, try to use “does not contain” instead.

The node is set to “Always return an output”. This is an empty item, sorry for not mentioning it.

hello @honzapav

I suppose the issue is with the wrong variable type. by default n8n will treat it as string, but your array consists of numbers.

Try to replace the second part with:
{{ parseInt($json.gid) }}

You can see the variable types in the Schema view

2 Likes

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