Array Compare issue
Options
Khan aqib
Member ✭
i have two array like array[A] and array[B] i want compare both array element are same or not and which element is not present in array
Example
arrA=['hello','hii','ok']
arrB=['hello','hii']
if we are compare this both array than in arrB 'ok' element not inside of arrB
any solution for this???
Example
arrA=['hello','hii','ok']
arrB=['hello','hii']
if we are compare this both array than in arrB 'ok' element not inside of arrB
any solution for this???
Comments
-
Hi, Im not totally sure what you are trying to answer.
Do you want:
1. a function that returns true when passed arguments of [A,B] and [A,B] but false when passed [A,B] and [A,B,C]? (array compare); or
2. a function that when passed [A,B] and [A,C,D] will return [B, C, D]? (array diff); or
3. Something different? From the above?
With for and while loops, one can make a function that does just about anything with arrays in Xano, but need to understand the inputs and outputs to recommend either a built-in or how you could approach with a custom function. -
First option
Do you have any solution for array compare -
The built-in array_diff function in Xano makes this relatively easy to do. You can ask which elements are in the first array but not in the second, and then ask the question in reverse to get the true/false you are looking for. I made a short video showing how to do this: https://www.loom.com/share/b645e1fb9a21420897c0acd75753e615
-
thanks
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