Filter objects in an array
Options
![pachocastillosr](https://us.v-cdn.net/6037124/uploads/userpics/MC7ELS8NG1HC/nPLP98RNMYYEZ.jpg)
pachocastillosr
Member ✭
Hi,
I am getting an array of products (json objects) as response from an external api call:
Example:
products =
[
{
id: 1,
name: 'Product 1',
price: 9.99,
description: 'Description of product 1'
},
{
id: 2,
name: 'Product 2',
price: 19.99,
description: 'Description of product 2'
}
]
I'd like to create a new array containing only the json objects of the products with price > 10 and empty description.
How can I do this?
Thanks!
Tagged:
Best Answer
-
Hi @pachocastillosr - you can use the function Array: Find All Elements to produce a new array of objects based on your two requirements:
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