Conditional query with a list inside the table.
Options
![Jonas Robertsson](https://us.v-cdn.net/6037124/user_avatars/2553137.jpg)
Jonas Robertsson
Member ✭
I have a table with price_lists, and a list of user_ids on each row in that table to check what price_lists the user have access to.
{
"pricelist_name": "test 1"
"users":[2,3,4]
},
{
"pricelist_name": "test 2"
"users":[2,4]
},
{
"pricelist_name": "test 3"
"users":[4]
}How would i return only the pricelists that a user have access to in Xano.
Using custom query but don't really know how to check inside a list, auth:id == price_list.user_list.id, wont do it.
{
"pricelist_name": "test 1"
"users":[2,3,4]
},
{
"pricelist_name": "test 2"
"users":[2,4]
},
{
"pricelist_name": "test 3"
"users":[4]
}How would i return only the pricelists that a user have access to in Xano.
Using custom query but don't really know how to check inside a list, auth:id == price_list.user_list.id, wont do it.
Comments
-
If I understand your issue correctly, the key to this is the "in" operator when applying a query filter, and making sure you have the right things on each side. Here's a video walking through the process. https://www.loom.com/share/63ed7052a42c42c08b03455d30cbbb00
-
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