Array Filter not working - what am I doing wrong?

Options

Hey Xano Community,

I'm a bit frustrated already because I'm stuck on a problem for so long that seems so easy to solve.

The setup:

I have an array of objects. I loop through this array and use "Find all Elements" to find certain items. I push those items into a second array outside of the loop.

Now, with each iteration, I want to check if the current item is already in the second array (because it was fetched with the "Find all Elements" Step) to avoid having it processed a second time. I tried this with:

  • diff filters
  • remove the item from the first array
  • in-filter
  • Precondition
  • If-Condition
  • Looping through the second array, find the item index matching the current iteration and remove it

None of these approaches worked for me. I don't get any error messages, It just ignores my filter.

I would be grateful If somebody could point me in the right direction. This is how my function currently looks like:

Thanks,

Stefan

Best Answer