Manipulating Arrays
Options
Mauro Mequelussi-1595850
Member ✭
I have 2 arrays:
arrayA = [ 1, 2, 3, 4, 5]
arrayB = [1, 2, 3, 4]
I need to create a new array only with the value that does not have in the 2 arrays, in this case arrayC = [5], as in the example above.
How can I do this? Is there any way I can subtract one array by the other so that only the values are different from the 2 arrays?
Comments
-
Hey Mauro,
Good question. We will be adding some new filters later today to make this easier. Stay tuned! -
spoke too soon... ran into a hiccup with the build. we are going to be deploying this on monday.
we will have filters to do a diff and an intersection. I'll reply back monday when the build is released. -
this is now live.
there are 4 new filters that can help with this.
diff
diff_assoc
intersect
intersect_assoc
the assoc variants are more friendly if the object key is important. If you just care about the values, then use the first version. -
I tested it here, it worked. Thanks again.
Feedback only. I think it's interesting to already add these new filters in the documentation with examples, this should reduce support. I always go there and do research when I have any questions or need to see if it's possible to solve a problem with the features that already exist in Xano.
I know your implementation speed is super fast, but it can make support easier in the long term as the staff is reduced. -
Thanks for the feedback. We are in the process of a massive documentation overhaul for this exact reason and we promise you'll see it get a lot better in the coming weeks!
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