Array Filter not working - what am I doing wrong?
![Stefan Klein](https://us.v-cdn.net/6037124/uploads/userpics/D2I4160YSIRA/nUFX5HR2SUSB2.jpg)
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
-
Still wondering, why some things didn't work, but I found a solution for the problem.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback