Filter to get an object based on key/value match in same array item
Options
![Ryan Anderson](https://us.v-cdn.net/6037124/user_avatars/2322716.jpg)
Ryan Anderson
Member ✭
I want to use a filter to get the "parties" object where `region_abbreviation` matches an input. How would I do this in Xano? I think it's a combo of Get() + Map() or Keys() but can't figure it out.
[
{
"region_label": "United States",
"region_abbreviation": "us",
"parties": [
{
"party_code": "A",
"party_label": "Democrats"
},
{
"party_code": "B",
"party_label": "Liberals"
}
]
},
{
"region_label": "Australia",
"region_abbreviation": "au",
"parties": [
{
"party_code": "A",
"party_label": "Aussie Greens"
},
{
"party_code": "B",
"party_label": "Aussie Liberals"
}
]
}
]
Ps. if you have any advice on a better way to store this data, I'm all ears 😃
Comments
-
I made a video walking through what I think is your your issue: https://www.loom.com/share/b1fd061d4e244ce98ed3ada9fcbcba50
-
This is brilliant (especially your reaction to my dummy data 😁)
I was hoping there was a way to do this without a loop but I guess not
Thanks for your help!
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