input an array as filter to select rows in a table - field is a table reference
I'm trying to passa an array as input to retrieve rows that contains my array.
1 - Scenario
DB.table.items_ref overlaps input(object[items]) »»»> Not working
2 - Scenario
DB.table.items_as_int_array overlaps input(integer[items]}) »»»> Working
The problem with secenario 2, is that I lost the benefit of the table reference. Is there any tips to having the scenario 1 working?
Best Answer
-
For the effect you are going for, a simplifying route is to have a simple array of table references (which are just ints under the covers, but maintain your connection), rather than array of objects that each have a table reference member. The object throws up barriers to the select part of the query.
Answers
-
Hi @Rodrigo What are you comparing the items_ref with in the first scenario? I am not sure I understand input(object[items]) . Maybe you can share a screenshot?
-
Thanks for spend your time reviewing it @Ray Deck
This is the scenario 2 I'm trying to do.
{"message":"ParseError: "test_get_array_filter.items_from_ref" overlaps [{"items_id":1}], message=1st operand must be json or a scalar array."}
This the scenario 1 that works - but I dont want use a simple integer Array w/o databse relantionship.
The difference on the scenario 1 is that I'm passing a integer array and on the database side I've create another integer array.
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