Filter N:N - comparing two values dynamically

Hello,

I would like to use filter that is using N:N. But I am not sure were do i make mistake or what am i missing. One side it working fine and is changing its value, but the results i get from the CODE4 is not working.

  1. My input store 1: “Category”: “A_17_046, T_23_025”,

  2. CODE node:

const kat = $(‘Code’).item.json.Category || ‘’;
const codes = kat.replace(/\u00A0/g,’ ‘)
.split(’,')
.map(s => s.trim())
.filter(Boolean);

return codes.map(code => ({ json: { code } }));

  1. My output:

[{

“code”: “A_17_046”

},

{

“code”: “T_23_025”

}]

  1. Filter node: for this I am using value LEFT (it is just list of items that contains categories like N_17_000 - Store, etc. ). The value RIGHT is Code4 (What i coded above).

Only value on the LEFT is changing during the run and value on the RIGHT is stuck on A_17_046. I would like to get value on the right dynamic, so i get the other values which went from my script.

  1. Output of filter should be found categories from the list. (example: If i have category T_23_025, and Code will also find such category from row value, then this T_23_025 will pass, if both value).

Can you please help me to solve it?

Thank you very much.

Pleas attach your workflow and provide an input data so we could see your issue in action. Please make sure to pin data required to understand the problem. Please also include expected output or action.

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